Commit graph

381 commits

Author SHA1 Message Date
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
Reece Dunham
c08e247b56
refactor(core): use native types from webpack-dev-server (#6279)
Signed-off-by: Reece Dunham <me@rdil.rocks>
2022-01-06 23:05:03 +08:00
Joshua Chen
cb1aa30286
refactor: enforce type import specifiers (#6230)
* refactor: enforce type import specifiers

* fix

* Upgrade esbuild

* Fix (haha)
2021-12-31 21:17:09 +08:00
Joshua Chen
24d65d9bdd
refactor(utils): reorganize functions; move authors file resolution to utils (#6229)
* refactor(utils): reorganize functions; move authors file resolution to utils

* More refactor
2021-12-31 11:55:42 +08:00
Joshua Chen
40e4ce0e68
chore: upgrade prettier; rename prettier scripts as format (#6010) 2021-12-01 12:33:22 +01:00
Joshua Chen
33de0cdf99
chore: upgrade netlify-cli (#6031) 2021-11-30 10:02:31 +08:00
Alexey Pyltsyn
b31044dc8a
chore: upgrade webpack-dev-server to v4.5.0 (#5998)
* chore: upgrade webpack-dev-server to v4.5.0

* Fixes after review

* remove type assertion

Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
2021-11-24 17:41:34 +08:00
Joshua Chen
0374426ce3
chore: upgrade TypeScript & other ESLint related deps (#5963)
* chore: upgrade ESLint related deps

* Upgrade TS

* Fix lock

* Bump Babel

* Update config
2021-11-18 21:15:37 +08:00
William Poetra Yoga
895c848065
fix: allow project directory name to be an invalid npm package name (#5842) 2021-11-01 17:07:54 +08:00
Sébastien Lorber
157b41caee
chore: replace doc sample .pdf file by .xlsx to solve Crowdin issue (#5823) 2021-10-29 14:46:21 +02:00
Sébastien Lorber
0b2d3483a1
fix: use @docusaurus/react-loadable as package alias + include types (#5819) 2021-10-29 11:04:07 +02:00
Avi Vahl
96da25e422
feat(core): upgrade to webpack-dev-server@4 (#5420)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-10-28 18:06:20 +02:00
Sébastien Lorber
1ce6253cc1
chore: require Node 14 (#5812) 2021-10-28 17:11:25 +02:00
Joshua Chen
1c8b8362f7
fix(live-codeblock): render static codeblock server-side (#5754)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-10-21 17:17:03 +02:00
Joshua Chen
c8739ec28e
polish(theme-classic): guard against potential definition mistakes in Tabs (#5674) 2021-10-14 15:47:03 +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
Sébastien Lorber
a0c2c52829
chore: remove unused Bootstrap theme (#5634)
* remove package

* remove bootstrap from doc

* remove bootstrap init template + examples

* remove bootstrap preset

* remaining bootstrap refs

* update lockfile
2021-10-01 17:44:34 +02:00
Bharat Middha
09550b0535
feat: properly type-check the Docusaurus config of new sites (#5589)
* fix: makes types DocusaurusConfig optional to match docs

* add UserDocusaurusConfig with required keys for user config

* convert UserDocusaurusConfig to use util type

* Docusaurus website config should be type-checked by CI + fix all existing issues

* add doc for config typechecking

* Update template configs for TS autocompletion

* fix last config typechecking bugs

* reapply prettier

* reapply prettier-docs

* Fix TS doc: add missing ()

* fix some docu plugin types

* add "const config" for simpler jsdoc annotation

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-09-30 17:49:44 +02:00
Joshua Chen
3f1f8255a2
chore: upgrade Prettier + regenerate lock file (#5611)
* Bump deps

* Run prettier

* Format docs

* Minor refactor

* Collapse objects

* Fix type

* Update lock file
2021-09-30 12:54:17 +02:00
Alexey Pyltsyn
b62a12bfc6
chore: upgrade dependencies (#5608)
* chore: upgrade dependencies

* Revert github-slugger

* Fixes

* Update snapshots

* Update Babel deps
2021-09-24 16:36:41 +02:00
Joshua Chen
a839966cd2
polish: remove unused eslint-disable (#5560)
* fix eslint

* Add report unused disable to CI

* Fix two anys
2021-09-21 18:07:54 +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
631c4685fb
chore: rename docusaurus-2-website package + refactor scripts (#5397) 2021-08-20 18:11:13 +02:00
Sébastien Lorber
b5ecf270d9
fix: fix canary release version name (#5295) 2021-08-05 14:19:58 +02:00
Sébastien Lorber
33b88ab717
fix: fix canary release versions (#5285) 2021-08-04 18:34:06 +02:00
Sébastien Lorber
700a82aefe
feat: multiple playground choices (#5207)
* poc of using netlify functions for playground redirections

* push

* cleanup

* restore files

* fix netlify functions?

* fix netlify functions?

* implement serverless functions for playgrounds with persistent cookie

* move new.docusaurus.io to monorepo packages

* move new.docusaurus.io to monorepo packages

* lockfile

* push

* catch-all redirect

* Translate/Interpolate: add better error message if not used correctly

* Add /docs/playground page

* Add some additional doc
2021-07-22 21:10:36 +02:00
Sébastien Lorber
04bcdbd3e1
fix(v2): fix yarn clear command (#5166) 2021-07-14 16:07:56 +02:00
Sébastien Lorber
d7c2df6530
chore: upgrade Crowdin (#5137) 2021-07-09 19:35: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
df8a900f9c
feat(v2): add trailingSlash config option (#4908)
* POC: add trailingSlash option

* integrate the preferFoldersOutput option of fork @slorber/static-site-generator-webpack-plugin

* Fix broken links when using trailing slash => using md links is more reliable

* fix TS issue

* minor polish

* fix doc page being sensitive to trailing slashes

* Add tests for applyTrailingSlash

* rename test files

* extract and test applyRouteTrailingSlash

* update snapshot

* add trailing slash config to serve command

* fix getSidebar() => still sensitive to trailing slash setting

* never apply trailing slash to an anchor link

* Add documentation for trailingSlash setting
2021-06-09 19:59:39 +02:00
Sébastien Lorber
aaeda674b1
chore: fix canary version name (#4791) 2021-05-14 13:03:20 +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
acc92461b0
chore: fix GH actions lint problem matchers issue in PR (#4471) 2021-03-19 18:53:46 +01:00
Armano
357ea7d836
chore(v2): migrate babel-eslint to @babel/eslint-parser (#4453)
* chore(v2): migrate babel-eslint to @babel/eslint-parser

* chore(v2): align facebook example packages

* chore(v2): lock babel-eslint for docusaurus-1x

* chore(v2): align pakcages in facebook init template

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-03-19 11:59:36 +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
Armano
03c3e0def1
chore(v2): update typescript-eslint to v4.18.0 (#4452) 2021-03-18 16:10:16 +01:00
Reece Dunham
76c0b11632
refactor(v2): TS config update: reduce the size of npm modules (#4375)
* feat(v2): Reduce the size of the npm modules

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

* Fix conflicts

* Update search.js

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-03-17 16:25:42 +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
Armano
e6261af642
refactor(v2): remove duplicated lodash dependencies and import only what needed (#4361)
Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-03-09 12:15:52 +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
Alexey Pyltsyn
175d9c3c8e
feat(v2): support/use React v17 by default (#4218)
* chore(v2): allow React v17 as peer dependency

* minor React 17 changes

* Revert examples

* Possible fix

* Use @docusaurus/react-loadable fork

* add back react-loadable to please eslint/ts/linters, even if it's unused in practice

* missing dependency bump

* move enzyme dependencies to docusaurus v1

Co-authored-by: slorber <lorber.sebastien@gmail.com>
2021-02-12 17:04:45 +01:00
Alexey Pyltsyn
d22039c200
chore(v2): upgrade dependencies (#4148)
* chore(v2): upgrade dependencies

* Update docs

* Revert `execa`

* Revert sitemap
2021-02-02 14:37:45 +01:00
Reece Dunham
95f81d2a44
refactor(v2): Switch from inquirer to prompts (#4091)
Signed-off-by: Reece Dunham <me@rdil.rocks>
2021-01-27 16:53:43 +01:00
Sébastien Lorber
20b6997ad6
chore(v2): install Crowdin cli through npm package (#4030) 2021-01-12 16:23:25 +01:00
Reece Dunham
a406a3c9aa
chore(v2): docusaurus-init: switch from inquirer to prompts (#4012)
Signed-off-by: Reece Dunham <me@rdil.rocks>
2021-01-11 15:33:40 +01:00
Sébastien Lorber
c4cbe8ec72
chore(v2): prettier fixes (#4005) 2021-01-06 17:07:34 +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
Sébastien Lorber
e90749c6f8
fix(v2): to fix the canary release GH workflow (#3852)
* attempt to fix the canary release  GH workflow

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to fix canary-releases.yml

* attempt to make the canary workflow work again

* try to fix canary again

* try to fix canary again

* try to fix canary again
2020-12-02 20:15:12 +01:00
Sébastien Lorber
28a83d73e3
feat(v2): add automated canary releases (#3827)
* attempt to add automated canary releases

* fix canary releases workflow
2020-12-01 11:56:59 +01:00