Commit graph

219 commits

Author SHA1 Message Date
Kristoffer K
b48c6defae
fix: declare missing dependencies (#6097)
* fix(utils-validation): add missing peer dependencies `react` and `react-dom`

* fix(theme-classic): add missing peer dependency `@docusaurus/core`

* ci: disable PnP fallbacks

* ci: link to the docs

* Update package.json

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-12-13 09:47:07 +08:00
Joshua Chen
4809a1aab1
chore: add NPM and PNPM to E2E tests (#6080)
* chore: add NPM and PNPM to E2E tests

* Align node versions

* Install PNPM

* Fix options

Maybe fix

Fix
2021-12-10 22:04:05 +08:00
Joshua Chen
e07ebadf6c
fix: make Docusaurus PnP strict mode compatible (#6047)
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2021-12-08 14:26:24 +01:00
Joshua Chen
d5d10f5656
chore: add prefix to needs triage label; separate Windows test workflow (#6068)
* chore: add status prefix to needs triage label

* Separate Windows workflow
2021-12-08 09:23:47 +08:00
Joshua Chen
40e4ce0e68
chore: upgrade prettier; rename prettier scripts as format (#6010) 2021-12-01 12:33:22 +01:00
Ludovico Fischer
5678911555
chore: update @svgr/webpack to version 6 (#5958)
* chore: update @svgr/webpack to version 6

* svgr changelog https://github.com/gregberge/svgr/releases
* SVGO 2 changelog https://github.com/svg/svgo/releases/tag/v2.0.0
* depend on maintained svgo version
* although svgr 6 is in alpha, it fixes a few issues
  with webpack 5 (https://github.com/gregberge/svgr/commit/1a8cc98)
  and React (https://github.com/gregberge/svgr/commit/3700aba)
* see also https://github.com/facebook/docusaurus/pull/5703

* Fix config

* fix e2e test

* Fix again

* Update to stable

Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-29 15:12:18 +08:00
Joshua Chen
057e3f34da
chore(ci): add GitHub action for showcase testing (#6002) 2021-11-24 18:25:49 +08:00
Joshua Chen
87a486a02f
chore: generate dogfooding test for long pathname during CI (#5977)
* chore: generate dogfooding test for long pathname during CI

* Fix test

* Fix again
2021-11-20 14:18:50 +08:00
Joshua Chen
7a07963c42
misc(workflow): E2E tests should not be run with website changes (#5919) 2021-11-10 17:36:39 +08:00
Joshua Chen
8fba542d26
chore(workflow): merge jobs into one workflow & give each job a name (#5907) 2021-11-08 22:04:39 +08:00
Joshua Chen
66771bd80d
chore(workflow): remove v2 prefix from titles (#5833) 2021-10-30 15:48:38 +08:00
Oscar Dominguez
41346e0abf
chore(workflow): add cache to workflows using actions/setup-node (#5697)
* ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows

* Use cache: yarn

* Reformat

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
2021-10-30 15:27:06 +08:00
Sébastien Lorber
3b66c68e92
feat: Support Node 17 (#5814) 2021-10-29 17:21:01 +02:00
Sébastien Lorber
1ce6253cc1
chore: require Node 14 (#5812) 2021-10-28 17:11:25 +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
Paul O’Shannessy
ac2b0f7db2
chore: set up CodeQL (#5499)
Let's try this.
2021-09-08 13:58:33 +03:00
Joshua Chen
df3752cc71
fix: fix a few TS errors (#5437)
* fix errors

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

* Fix website

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

* Revert adding lib

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

* Fix tsconfig

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

* Restore previous ordering

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

* exclude sw.js from typechecking

* Tests: include typechecking of website

* cleanup @site/ alias in TS config

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-30 13:06:00 +02:00
Sébastien Lorber
631c4685fb
chore: rename docusaurus-2-website package + refactor scripts (#5397) 2021-08-20 18:11:13 +02:00
Paul O’Shannessy
8341527fc9
refactor: rename Git master branch to main (#5345)
* Prepare to renaming master branch to main

* Update CONTRIBUTING.md

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/missing_version_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/complex_website/website/package.json

* Update packages/docusaurus-migrate/src/__tests__/__fixtures__/simple_website/website/package.json

* missing master -> main replaces

* useless char

* For GH Pages org deploy, DEPLOYMENT_BRANCH env is now required

* fix versioning page

* fix vercel links

* update deployment.mdx

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-08-17 18:41:53 +02:00
Sébastien Lorber
ac4a253cdf
chore: fix e2e yarn berry tests (#5342)
* disable pnp

* test-release support --skip-install + revert to pnp mode

* fix yarn canary?

* add YARN_ENABLE_IMMUTABLE_INSTALLS env

* add nodeLinker matrix

* Update .github/workflows/v2-tests-e2e.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* polish e2e test workflows

* polish e2e test workflows

* set npm_config_registry

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2021-08-12 13:18:07 +02:00
Sébastien Lorber
b5ecf270d9
fix: fix canary release version name (#5295) 2021-08-05 14:19:58 +02:00
Sébastien Lorber
4d06f26c1f
fix(v2): Fix MDX docs being considered as partials when siteDir match the _ prefix convention (#5199)
* Add _ to dogfood docs folder to cover against edge case

* Fix edge case with MDX partials when site / content dir contains a _ prefix

* add globUtils tests

* proper dogfooding folder re-organization, all content plugins being used

* refactor dogfooding folder + expose /tests page index

* fix page plugin ignoring options.routeBasePath
2021-07-21 14:13:51 +02:00
Alexey Pyltsyn
9536ef900d
feat(v2): redesign mobile UX: inline TOC + doc sidebar in main menu (#4273)
* feat(v2): mobile TOC

* Bug fixes and various improvements

* Redesign

* extract TOCCollapsible component

* TS improvements

* Assign sidebar name directly to the doc route => no need for either permalinkToSidebar or GlobalData

* revert changes to useWindowSize, fix FOUC issues

* extract DocSidebarDesktop component

* remove now useless menu infima classes

* TOCHeadings => rename + remove unused onClick prop

* Extract DocSidebarItem

* minor renaming

* replace GlobalData usage by a React teleport system to render in the navbar mobile sidebar menu directly from the DocPage component

* useWindowSize => simulate SSR size in dev to make FOUC issues more obvious

* fix remaining sidebar layout shift

* update docs snapshots

* remove unused code translations

* remove unused code translations

* fix minor update-code-translations bug

* Add more build-size paths to watch

* Restyle back button

* Add  missing`menu` class

* extract useShallowMemoizedObject

* fix routes tests + better routes formatting

* use Translate api for labels

* use Translate api for labels

* Update translations

* Improve dark mode support for back button

* Merge branch 'master' into lex111/inline-color-code

# Conflicts:
#	packages/core/dist/css/default-dark/default-dark-rtl.min.css
#	packages/core/dist/css/default-dark/default-dark.min.css
#	packages/core/dist/css/default/default-rtl.min.css
#	packages/core/dist/css/default/default.min.css

* replace useCollapse by new useCollapsible

* Cleanup and use clean-btn for TOCCollapsible button

* Make TOC links clickable over full width

* Cleanup

* fix uncollapsible sidebar that can be collapsed + create <Collapsible> component

* dependency array typo

* rollback sidebars community commit typo

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-07-09 16:50:38 +02:00
Sébastien Lorber
f03479f69e
test(v2): dogfooding: add huge sidebar for testing purposes (#5130)
* dogfoog: add huge sidebar for testing purposes

* Add standalone doc + build-size tracking
2021-07-08 20:26:55 +02:00
Sébastien Lorber
ed9d2a26f5
misc: monitor site global data with build size bot (#5111) 2021-07-01 18:44:19 +02:00
Sébastien Lorber
4d93c894f2
chore: unstable yarn.lock (#5067)
* fix unstable yarn.lock

* remove useless typescript dep
2021-06-25 16:19:12 +02:00
Lucas Correia
34411e12e5
fix(v2): truncate docuhash return value in order to avoid ERRNAMETOOLONG error (#4899)
* fix: truncate docuhash return value in order to avoid ERRNAMETOOLONG error

* chore: add deep file path test page to website

* refactor: reorganize docuHash/pathUtils code and tests

* chore: git support longpaths on v2 windows tests workflow

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-06-15 18:39:06 +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
6fe7c0cd6f
fix(v2): use yarn install --frozen-lockfile on CI 2021-06-09 15:18:07 +02:00
Sébastien Lorber
f0d4d8dfc7
chore: fail CI if yarn.lock is modified on install (#4897) 2021-06-03 14:56:22 +02:00
Reece Dunham
05e7250c08
feat(v2): Webpack 5, PostCSS 8 (#4089)
* Initial webpack 5 work

* It works on my machine (lol)

* Committing a bit more work

* It works - sorta

* Update packages/docusaurus/package.json

* at least fix prettier /shrug

* making more progress. build should work now, css stuff is still a bit broken

* Terser things

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

* Working on things

* Vendor webpack

* Repair chunks, and tests

* Rerun prettier

* Re-add client prefetching

* Update snapshots

* Update snapshots

* I hope this works

* Remove redundant dev server code

* relock

* Trying to reduce memory usage and fix things

* Dead code elim

* Search bar works!!!

* Prefetching should work again

* lock

* ts issue

* Repair snapshot

* Run prettier

* Fix the CI for now

* fix lint-prettier

* clean-css works, now for the other one

* Fix lockfile

* Fixes prettier

* Other css minification works!!!

* Add clean-css options, fix webpack versions

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

* Fix tests and several of the webpack loaders

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

* Re-add support for simple css minifier

* Update other related dependencies

* Fix lockfile

* Dev server fixups

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

* Simplify css things

* Update webpack, try with postcss 7

* Other cssnano repairs

* fix lockfile

* Clean up the babel preset

* Fix lockfile

* Bump RL SSR version

* Fix the build errors

* Lockfile fix

* It works again

* webpack 5 should close compiler after run

* add proper webpack5 persistent caching config

* upgrade webpack deps again

* reduce build perf timeouts to avoid build time regressions

* test if incremental build can run on netlify

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* test

* test

* test

* test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* fix existsSync() calls

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* replace @ts-nocheck by a temporary Webpack type

* migrate existing stats.warningsFilter to config.ignoreWarnings

* remove stats from postBuild lifecycle data doc, as it is likely unused (we'll add it back if someone ask for it)

* improve build.ts TS issues + move some sync code to async

* cleanup TS of start.ts

* fix TS error

* fix TS issues

* fix TS issues

* fix ts error

* netlify test

* netlify test

* netlify test

* netlify test

* netlify test

* script cleanup

* script cleanup

* re-enable @typescript-eslint/ban-ts-comment

* Deprecate getCacheLoader / getBabelLoader but keep retrocompatibility

* useless TS

* fix and comment gca(chunkName) prefetching function

* remove deprecated mainTemplate.requireFn

* temporarily use react-loadable-ssr-addon-v5-slorber until PR merged: https://github.com/facebook/docusaurus/pull/4089

* comment unsafeCache option

* add explicit and more precise webpack targets

* splitChunks, use new type: "css/mini-extract" as it seems recommended for webpack 5

* webpack error handling:
- log error.details as documented
- keep using react-dev-utils/formatWebpackMessages for now

* fix webpack5 warnings for evalSourceMapMiddleware.js

* typo

* rename webpackHotDevClient

* make all modifications of react-dev-utils explicit with a comment

* revert LogPlugin adapter

* loader-utils update

* add useful share cache comment

* add useful comments regarding the null-loader used in SSR for css files

* upgrade webpack-merge in a retrocompatible way

* use MiniCssExtractPlugin.emit false as recommended

* use @docusaurus/responsive-loader

* revert MiniCssExtractPlugin esModule: false change

* add link to PR for custom CleanWebpackPlugin

* pwa: add fallback to env variable or webpack 5 fails to build

* upgrade to CssMinimizerPlugin 2.0

* only build en locale for windows tests

* line breaks between errors

* add useful comment

* Fix e2e tests with Yarn2 not finding new init template dependencies

* fix bad import

* disable browserslist target as webpack already tries to use browserlists if a config is found, and it is a problem for existing sites

* webpack5 TS fixes

* fix getMinimizer order (even if it does not work yet)

* update postcss to v8, fix cssnano minimizer errors

* add NavbarItem position to types (useful for QuestDB site upgrade to Webpack5)

* add webpack cache env variable to reduce risk of webpack 5 adoption

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-04-30 18:06:53 +02:00
Sébastien Lorber
8119de105a
chore(v2): do not build all locales when monitoring build time perf (#4611) 2021-04-14 09:28:38 +02:00
Sébastien Lorber
f7614081dd
ci(v2): fail CI if build takes too much time (#4516)
* remove the .cache folder so that it removes both webpack cache-loader-v4/persistent-cache-v5 + webpack terser cache

* Add GH action to track build time perf with a timeout

* Add GH action to track build time perf with a timeout
2021-03-25 17:30:49 +01:00
Armano
88a48a072a
ci: enable yarn install cache (#4486)
* test: enable yarn install cache

* ci: correct cache key

* ci: update caching to use bahmutov/npm-install
2021-03-25 16:29:32 +01:00
Armano
839d9d70ba
ci: change default actions timeout from 6h to 30m (#4508) 2021-03-24 12:24:44 +01:00
Sébastien Lorber
acc92461b0
chore: fix GH actions lint problem matchers issue in PR (#4471) 2021-03-19 18:53:46 +01:00
Sébastien Lorber
5543f09ed1
chore: json files should be linted (#4462) 2021-03-18 19:39:50 +01: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
Long Ho
1078341b22
refactor(v2): i18n cleanups / refactors (#4405)
* chore: fix various intl stuff
- remove intl-locales-supported & intl since they're deprecated and only
needed for IE11
- add new polyfills for node 12
- clean up babel intl extractor
- reset jest test timezone to UTC so it passes even for East Coast
contributor

* chore: change build to include Node 14

* docs: update i18n reqs
2021-03-15 18:02:53 +01:00
Sébastien Lorber
4dad3bf96b
misc: restore build size bot (#4337)
* restore build size bot

* update
2021-03-03 16:36:40 +01:00
Yangshun Tay
572746d65f
chore: delete build size bot (#4334)
We've found a vulnerability in the way we configured this action. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests
2021-03-03 18:54:27 +08:00
Sébastien Lorber
db7a3482f4
chore(v2): Fix build size bot (#4248)
* Fix build size bot

* use compression: 'none'
2021-02-19 10:44:06 +01:00
Alexey Pyltsyn
f13448d5e1
chore(v2): upgrade dependencies + require Node 12 (#4223)
* chore(v2): upgrade dependencies

* Set minimum Node.js version to 12.13

* Fix test

* Upgrade copy-text-to-clipboard

* Bump Node versions

* Update .nvmrc

* mark cacheTime as forbidded field

* Downgrade jest to v25.2.7

* Increase Node version for Windows CI

* Test fix

* Attempt to fix Windows CI

* Downgrade execa

* fix async test errors

* Upgrade execa

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-18 15:12:42 +01:00
Sébastien Lorber
ffb2d29366
chore(v2): fix build-size bot again (#4159) 2021-02-02 18:46:22 +01:00
Sébastien Lorber
fe6b841642
chore(v2): fix build size bot monitoring of js/css assets (#4156)
* fix build-size bot monitoring

* fix build-size bot monitoring
2021-02-02 16:57:37 +01:00
Sébastien Lorber
141d062c3b
chore(v2): fix windows Jest tests (#3959)
* test(v2): Fix docusaurus-utils tests for windows

* test(v2): Fix plugin-client-redirects test

- add the posixPath in writeRedirectsFiles.ts

* test(v2): Fix plugin-content-pages test

add posixPath in test and index

* test(v2): add window test configuration

 - add the window test configuration in nodejs-windows.yml

* test(v2): revert plugin-content-pages test fix

* test(v2): Fix mdx-loader/transformImage test

* test(v2): add cleanPath in transformImage test

* fix version path tests for windows

* make versionMetadata test work on Windows

* try to fix posix/win32 path issues

* attempt to fix windows test

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* specific jest config for windows

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* remove bad cleanPath fn

* try to fix windows tests

* try to fix windows tests

* blog: try to fix windows tests by using same logic as on docs plugin

* try to fix windows tests

* try to fix windows tests

* try to fix windows tests

* try to fix windows tests

* improve the Github CI setup for windows: make jobs run in parallel

* revert GH action change

Co-authored-by: Sachin Kumar Rajput <skr571999@gmail.com>
2020-12-28 19:50:12 +01:00
Sébastien Lorber
4dea2c0819
chore(ci): fix canary release filtering (#3907)
* checkout before using dorny filters

* add     runs-on: ubuntu-latest

* fix
2020-12-11 17:10:45 +01:00
Sébastien Lorber
358ef86edf
chore(ci): only publish @canary release if packages/** has changed 2020-12-11 16:37:58 +01:00
Bartosz Kaszubowski
9fd8a3c693
chore(ci): increase Lighthouse CI max_timeout (#3884) 2020-12-07 15:50:50 +01:00
Bartosz Kaszubowski
99e3ee796e
chore(ci): run V1 Build and Migration CLI tests conditionally on CI (#3863)
* chore(ci): run V1 Build and Migration CLI test conditionally on CI

* chore(ci): extend lighthouse timeout to 5 minutes

* chore(ci): attempt to speed up build size check

* chore(ci): use different build command in build size check

* chore(ci): use only one locale in build size report workflow

* chore(ci): fix quotes, move build-script param down
2020-12-02 20:19:28 +01:00