Граф коммитов

65 Коммитов

Автор SHA1 Сообщение Дата
Piotr Płaczek 457bd50df0
feat: API History (#594)
* feat(api-history): basic webpack and remark plugin

* feat(api-history): basic table

* feat(api-history): minor table styling

* refactor(api-history): move regexp to variable

* feat(api-history): better regexp

* feat(api-history): move plugin to own file

* feat(api-history): remove `removed` property

* feat(api-history): fetch version using pr

* feat(api-history): types for data fetch code

* refactor(api-history): more readable row sorting

* feat(api-history): changes markdown support

* feat(api-history): strip comment tags in pre-build instead of plugin

* feat(api-history): `pr-release-versions-plugin`

* feat(api-history): use react component instead of handmade AST

* fix(api-history): revert accidental dependency

* refactor(api-history): get pr releases in transformer, remove plugin

* docs(api-history): todo in transformer

* docs(api-history): add temp example api history and schema for pr review

* fix(api-history): update `yarn.lock` for now

* feat(api-history): use example pr versions by default for now

https://github.com/electron/website/pull/594#discussion_r1662921815

* refactor(api-history): move `ApiHistoryTable` styles to module

https://github.com/electron/website/pull/594#discussion_r1665401454

* style(api-history): better var name, fix style lint

https://github.com/electron/website/pull/594#discussion_r1665405557

* feat(api-history): map pre-releases to released stable versions

* feat(api-history): better styles, remove pr number

* feat(api-history): link table change to breaking-changes

* fix(api-history): provide key for table elements

* feat(api-history): table semver ranges

Co-authored-by: Samuel Attard <sam@electronjs.org>

* feat(api-history): better error handling

https://github.com/electron/website/pull/594#discussion_r1671021901

* feat(api-history): type predicates in transformer

https://github.com/electron/website/pull/594#discussion_r1671021901

* feat(api-history): update to accepted schema

https://github.com/electron/rfcs/pull/6

* docs(api-history): remove old comments

* feat(api-history): only pre-process `/docs/api/*.md` containing `<!--`

* Update scripts/tasks/preprocess-api-history.ts

Co-authored-by: Kevin Cui <158blackhole@gmail.com>

* fix(api-history): match api history block consistently

* feat(api-history): pre-process more error checking

* Update docs/latest/api-history.schema.json

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* fix(api-history): duplicate dependencies

* docs(api-history): remove unnecessary comment

* refactor(api-history): move pre-process deps to dev deps

* feat(api-history): `isHtml(node)` type guard

https://github.com/electron/website/pull/594#discussion_r1678184944

* fix(api-history): missing `toLowerCase()`

* Update scripts/tasks/preprocess-api-history.ts

Co-authored-by: Kevin Cui <158blackhole@gmail.com>

* Update scripts/tasks/preprocess-api-history.ts

Co-authored-by: Kevin Cui <158blackhole@gmail.com>

* Update src/components/ApiHistoryTable.tsx

Co-authored-by: Kevin Cui <158blackhole@gmail.com>

* revert(api-history): `isHtml(node)` type guard

This reverts commit 9481b1caa5.

* feat(api-history): tell user to run `lint-roller`

* fix(api-history): stricter change type param

* Apply suggestions from code review

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* style(api-history): fix lint

* fix(api-history): remove unnecessary null check

* style(api-history): fix lint

* docs(api-history): stricter schema

Reference: c9de2c5f63

* docs(api-history): `ipc-renderer`

Reference: https://github.com/electron/electron/pull/42982#discussion_r1692533981

* docs(api-history): `browser-view`

* ci: use GH token with correct permissions

* fix(api-history): change semver sign if backport is `x.0.0`

Reported-by: David Sanders <dsanders11@ucsbalum.com>

* fix(api-history): preprocess warn on missing schema

* Update src/components/ApiHistoryTable.tsx

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* refactor(api-history): better semver logic

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Based-on-patch-by: David Sanders <dsanders11@ucsbalum.com>
Reference: https://github.com/electron/website/pull/594#discussion_r1712450684

* refactor(api-history): remove test `docs/`

`git diff feat/api-history origin/main -- docs/latest/api/ | git apply`

* refactor(api-history): remove test PR data

---------

Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Kevin Cui <158blackhole@gmail.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2024-08-12 11:01:41 -07:00
David Sanders 8d3248b1c8
chore: remove got dependency in favor of built-in fetch (#609) 2024-08-01 13:04:02 -07:00
David Sanders 79cd8b131f
chore(prebuild): remove make-dir dependency (#600) 2024-07-10 13:51:24 -07:00
Erick Zhao c3c1078169
fix(prebuild): clean up doc sync matcher (#598) 2024-07-05 10:09:32 +08:00
David Sanders e5a2f9e19a
chore: drop usage of node-fetch (#571) 2024-06-06 10:20:13 -07:00
Erick Zhao 7f807efdc8
build: upgrade to Docusaurus 3 (#563)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2024-05-31 15:10:27 -07:00
Erick Zhao cd0a4bc5c8
build: upgrade to TypeScript 5.3 (#560) 2024-05-07 12:21:40 -07:00
David Sanders 42e9ec7443
ci: use signed commits with a GH app (#533)
* ci: use signed commits with a GH app

* ci: use environment

* ci: use environment
2024-04-10 14:07:42 -07:00
Erick Zhao fd88af004f
fix(md): ensure <img> tags self-close (#465) 2023-11-02 12:36:44 -07:00
Erick Zhao 329c555360
fix(md): ensure `</details>` tag is on newline (#458)
fix(md): ensure </details> is on newline
2023-10-16 21:14:01 -07:00
David Sanders f5be1c69d3
feat: support inlining API structure links with ?inline query param (#394) 2023-04-18 16:22:46 -07:00
David Sanders 915282a5d0
chore: fix typos in comments (#399) 2023-03-30 11:04:53 -07:00
Erick Zhao 2edde7b069
style(pre-build) apply prettier on sidebar gen (#384) 2023-03-15 11:24:22 -07:00
Erick Zhao 053e6e7e01
chore: ignore synopsis doc for sidebar generation (#383) 2023-03-14 18:14:48 -07:00
Erick Zhao 436dc72928
refactor(gov): generate page on buildtime (#379) 2023-02-24 15:04:14 -08:00
David Sanders eeffd0cbe6
fix: remove old support page from sidebar (#363)
* fix: remove old support page from sidebar

* ignorelist the doc from script

---------

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2023-01-31 15:39:51 -08:00
Erick Zhao 3d22942c3d
fix(i18n): add glossary support for multi-word events (#353)
Skips single-word Electron events because these can be common words we
want to translate such as `closed` or `quit`.gcb

Orthogonal bugfix: also uses `continue` to skip loop iterations rather
than `return`.
2023-01-26 10:31:12 -08:00
Erick Zhao c04e975021
feat(i18n): update Crowdin glossary programmatically (#351)
This re-implements functionality from
https://github.com/electron/i18n/blob/master/script/upload-crowdin-glossary.ts
with the new Crowdin V2 API and our new static
website.
2023-01-25 11:30:59 -08:00
Erick Zhao 965262db64
refactor: convert website to TypeScript (#330) 2023-01-16 11:21:30 -08:00
Erick Zhao 2da282468a
build: remove unused versioned docs scripts (#327) 2022-11-30 13:40:45 -08:00
Erick Zhao a5b7862d37
fix(api-structures): make transform work with i18n builds (#320) 2022-11-29 12:39:05 -08:00
Erick Zhao 1c3829cb4d
fix(i18n): remove unnecessary Docusaurus config hacks (#311) 2022-11-25 07:42:12 -08:00
Antón Molleda aa6a0fb986 chore: sidebar improvements
Move the "Tutorial" category towards the top.
Ignore "support".
2022-07-05 16:19:50 -07:00
Erick Zhao 97510889ef chore: update discord link 2022-06-15 15:25:38 -04:00
Erick Zhao a3f69ec6c8
fix: proper str replace in multiline image title (#217) 2022-04-18 11:41:48 -07:00
Antón Molleda b228804a5a
fix: admonitions for crowdin
Close #186
2022-03-09 11:16:35 -08:00
Erick Zhao 7473e835fa
build: add ESLint + Prettier config (#179) 2022-02-22 12:00:21 -08:00
Erick Zhao d545194854
fix(prebuild): better sidebar automation (#178) 2022-02-16 17:06:23 -08:00
Erick Zhao adf029c3cb build: fix crowdin build for admonition syntax 2022-02-14 23:43:39 -08:00
Erick Zhao 5efd4d770d
feat: sidebar guide improvements (#172) 2022-02-11 12:54:46 -08:00
Erick Zhao 64616efb0b
fix(prebuild): only prefix electron docs (#164) 2022-01-13 11:39:00 -08:00
Antón Molleda b1b40ab1a2 chore: fix sidebars 2021-11-04 10:37:44 -07:00
Erick Zhao 979bd0b728
feat: add governance page
Fix #75
Close #136

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>
2021-11-03 10:51:37 -07:00
Antón Molleda 64ce3695a7 update azcopy 2021-10-29 11:22:34 -07:00
Antón Molleda 2fd49164b9 chore: better handle versions menu
Use the version number instead of `Current` in the versions drop down as
well as its title when visiting the latest documentation. Previous
branches only have a link to the most up-to-date docs to avoid getting
stale.

This also removes the pre-commit hook to avoid issues adding new
versions to translate (which is unnecessary).
2021-10-22 16:48:12 -07:00
Antón Molleda 3cd8630e2e chore: improve adding new docs to sidebars'
Fix #95
2021-10-22 16:34:44 -07:00
Antón Molleda 707718fa7a fix: new docs process
The `.gitignore` was too aggressive and new files under `docs/latest`
weren't added. Now we ignore the `vXX-y-z` folders.

Also tweaked the `sidebars.js` creation process so new tutorials are
added under `How To` instead of creating a new section.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Rel #95
2021-10-22 09:54:33 -07:00
Antón Molleda 17a1bd6872 feat: versioned docs
The way versioned documents are supported on the site differs a bit from
Docusaurus' documentation:

- Each doc change to a branch is build and publish separately.
- The links to the versions are `_blank` to bypass `react-router` even
  though the content is in the same server. The reason is that because
  it is built at different steps it is not "found".

This is achieve thanks to `electron-website-updater` sending a
`repository_dispatch` event with 2 different types of actions for each
`push` event that happens in `electron/electron` that contains doc
changes. The 2 types of events are:

* `doc_changes_branches`: Updates to documentation branches (does not
  matter if they are the latest or not).
* `doc_changes`: Updates to the latest stable branch.

The tasks to perform are almost identical and are split in two different
GitHub actions for each event:

1. Download the markdown for the SHA, check if there are new version
   branches and update `versions-info.json`, update the SHA, and publish
   those changes to Git.
   This is done in `update-docs-XXX.yml` when we receive the event.
2. Build the content for that branch and publish in the right place.
   This is done in `push-XXX.yml` when there is a push to `main` or a
   `vXX` branch.

The deployment is done to the storage service. The difference is that a
branch will only push `assets` and `docs` while `main` will publish
everything.

Additionally, Crowdin gets updated every time there is a change in
`main` to make sure the latest content is always uploaded.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #118
2021-10-21 17:36:22 -07:00
Antón Molleda 3d3033d401 fix: process doc changes task 2021-10-19 09:08:55 -07:00
Antón Molleda 8fb226af91 feat: Crowdin integration
Integrates with Crowdin to enable i18n of the site. This PR changes the
source of truth for Crowdin and moves it to this repository instead of
relying on `electron/i18n`.

Additionally it uses Crowdin's CLI to do the upload/download of assets
making it more reliable.

The website is built on locale at a time via `yarn i18n:build`.
Otherwise the process crashed with an out of memory error. The regular
`yarn build` command still compiles the `en` locale.

Because we cannot get notifications when there are new translations
avaiable, there is a GitHub workflow (`update-i18n-deploy.yml`) that
downloads the content every few minutes, builds, and deploy. To speed up
this process, the previous generated assets are download. In local tests
this reduces the build times from 250s to 40s so the whole process
should take about 5 minutes.

The previous generated content is stored in Azure Storage. Because this
is a static website it makes more sense than having a dyno and will make
it easier to:
- deploy multiple locales at the same time if we still need to speed up
  the process
- have versioned docs because we just need to "take a snapshot" and
  publish to a different folder

The current live site is still not using this storage but will soon-ish.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #64
2021-10-11 06:09:39 -07:00
Antón Molleda 3527526ae1 fix: docs automerge workflow
Because `docs` is now tracked, the logic to decide when to push changes
or create a new PR has changed. This code searches now for new files
instead of just checking if `package.json` has been modified.

This bug was discovered via https://github.com/electron/electronjs.org-new/pull/113
2021-10-08 09:59:15 -07:00
Samuel Attard 19df2eeb15 fix: use @2x avatar photo for blog post authors 2021-09-15 13:10:14 -07:00
Antón Molleda 6a8544a550 chore: enable multi-author posts 2021-09-13 13:20:04 -07:00
Erick Zhao da41a71ed4
feat: improve sidebar organization
Close #96
2021-09-03 15:31:01 -07:00
Antón Molleda 5e4353e91a feat: activate blog plugin
Activate Docusaurus' blog plugin and make the previous posts available
in the new site.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #71
2021-07-21 13:08:13 -07:00
Antón Molleda f7d7de6c47 chore: update ref to docs 2021-07-19 21:05:28 -07:00
Antón Molleda cf657d5f30
chore: no docs only mode and folder structure (#70)
Disables Docusaurus' "docs only mode" and changes the folder structure
to be the same as upstream for easier content reorganization and
redirects.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #68
Fix #69
Close #70
Rel https://docusaurus.io/docs/docs-introduction#docs-only-mode
2021-07-19 20:50:56 -07:00
Antón Molleda f384250910 feat: add pre-commit hook to keep l10n in sync
The locale `i18n/en-US` is used by `electron/i18n` as the source to
translate content into other locales and avoid having to manually create
the different JSON files or keep them in sync.

Once those files are translated, they will be downloaded and put in
the right place for each locale. This will happen in an upcoming PR.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Close #67
Rel: #64
2021-07-14 09:26:35 -07:00
Erick Zhao 4e7b2655a9
fix: only trim trailing spaces for API markdown mod
We trim the final string output in this transformation, which inadvertently resets all
leading whitespace and flattens all Markdown lists in the API docs.

This PR uses `trimEnd()` instead of `trim()` to only remove trailing whitespace instead.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Close #57
2021-06-21 10:24:44 -07:00
Antón Molleda 51e5f58435 feat: navigation improvements
If a page has the same name as the folder where it is, it will become
the landing page for that section. E.g.: `/security/security.md` will be
available via `/security` instead of `/security`.

Also add the sections `Performance` and `Security` to the footer
navigation to increase awareness.
2021-06-10 08:46:32 -07:00