Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: rebuild with Vuepress v2 #1221

Open
wants to merge 159 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
8aad534
docs: use VuePress
DreamOfIce Feb 22, 2023
30d83ca
Merge branch 'master' of github.com:DreamOfIce/core-js
DreamOfIce Feb 22, 2023
a943a2c
docs: update docs
DreamOfIce Feb 22, 2023
87c3b2f
Fix a error
DreamOfIce Feb 22, 2023
fd6bb50
Fix a typo error
DreamOfIce Feb 22, 2023
951594f
Fix a typeset error
DreamOfIce Feb 22, 2023
5d59d71
docs: update doc
DreamOfIce Feb 23, 2023
fe6f2f5
Update .gitattributes
DreamOfIce Feb 23, 2023
0c4c921
Merge branch 'zloirock:master' into master
DreamOfIce Feb 23, 2023
51f833b
docs: update features in homepage
DreamOfIce Feb 23, 2023
95e09d6
docs: create folder for blogs
DreamOfIce Feb 24, 2023
62489fe
Merge branch 'master' of github.com:DreamOfIce/core-js
DreamOfIce Feb 24, 2023
c31f315
docs: fix broken logo
DreamOfIce Feb 24, 2023
528166a
docs: update doc
DreamOfIce Feb 24, 2023
6983ac5
docs: update compat page
DreamOfIce Feb 28, 2023
cd13aa8
docs: improve compat page
DreamOfIce Feb 28, 2023
18a552e
docs: complete compatibility page
DreamOfIce Mar 1, 2023
2e2d4e4
docs: add features
DreamOfIce Mar 4, 2023
4b23590
docs: format features.es-standard
DreamOfIce Mar 5, 2023
1689383
docs: format features/helper and web-standard
DreamOfIce Mar 5, 2023
7a4284a
docs: fix navbar error
DreamOfIce Mar 5, 2023
21c639a
chore: upgrade vuepress-theme-hope
DreamOfIce Mar 5, 2023
207c190
docs: make compat page works in IE8+
DreamOfIce Mar 5, 2023
a196433
docs: support IE8+ for compat page
DreamOfIce Mar 6, 2023
e9e7b9b
docs: fix compat page error
DreamOfIce Mar 6, 2023
38a78a5
docs: fix a typo error
DreamOfIce Mar 6, 2023
cc757a0
docs: fix a typo error
DreamOfIce Mar 6, 2023
b197e1c
docs: format features/es-proposal
DreamOfIce Mar 7, 2023
1e61b3d
docs: update Chinese translation
DreamOfIce Mar 7, 2023
7c36c19
docs: fix Chinese compat page error
DreamOfIce Mar 7, 2023
8ec2691
chore: update release script
DreamOfIce Mar 7, 2023
dcd4710
docs: save images and some improves
DreamOfIce Mar 7, 2023
fe39f28
docs: use auto catalog
DreamOfIce Mar 7, 2023
6723645
docs: update sidebar
DreamOfIce Mar 7, 2023
a9de84e
docs: use shiki highlighter
DreamOfIce Mar 8, 2023
19d8d4d
docs: automatic import of changelog
DreamOfIce Mar 8, 2023
8dfb6d0
docs: split contribution guide
DreamOfIce Mar 8, 2023
0c20392
docs: fix broken edit link
DreamOfIce Mar 9, 2023
876df6d
docs: fix error in last version
DreamOfIce Mar 9, 2023
b17eadc
docs: update docs
DreamOfIce Mar 9, 2023
882bb88
docs: update Chinese navbar
DreamOfIce Mar 9, 2023
c7c0887
docs: emove untranslated tag for dev/docs/
DreamOfIce Mar 9, 2023
d318dd9
Update .gitignore
DreamOfIce Mar 10, 2023
0c745e7
docs: fix a typo error
DreamOfIce Mar 10, 2023
ae11866
docs: update Chinese translation
DreamOfIce Mar 10, 2023
f393e07
docs: update category and tags
DreamOfIce Mar 10, 2023
a4c092b
Merge remote-tracking branch 'upstream/master'
DreamOfIce Mar 10, 2023
426afd5
docs: sync change in README.md
DreamOfIce Mar 10, 2023
8907faa
docs: sync Chinese page
DreamOfIce Mar 10, 2023
9c55d2a
docs: merge change from README.md
DreamOfIce Mar 13, 2023
633ad4c
docs: sync translate
DreamOfIce Mar 14, 2023
03ceaca
docs: sync changes to translation
DreamOfIce Mar 14, 2023
911439c
docs: some updates
DreamOfIce Mar 14, 2023
eae1eee
docs: lint code
DreamOfIce Mar 14, 2023
d3e9e10
docs: update some type of features
DreamOfIce Mar 15, 2023
9094605
docs: update some type
DreamOfIce Mar 15, 2023
2f5c2d4
docs: update some type
DreamOfIce Mar 15, 2023
3f41403
docs: create .gitlocalize.yml
DreamOfIce Mar 16, 2023
1b54493
docs: fix wrong types
DreamOfIce Mar 17, 2023
54bf9d7
Merge branch 'master' of github.com:DreamOfIce/core-js
DreamOfIce Mar 17, 2023
33ddd50
docs: fix wrong web-standard types
DreamOfIce Mar 17, 2023
22391ee
docs: update Chinese translation of /dev
stydxm Mar 17, 2023
0f50006
docs: improve current Chinese translation
stydxm Mar 17, 2023
feda7c5
docs: make Chinese guide collapsible
stydxm Mar 18, 2023
3d8bd94
docs: add missing icon
stydxm Mar 18, 2023
3a0a02c
docs: add navbar for contribution section
stydxm Mar 18, 2023
edef92f
docs: fix typo
stydxm Mar 18, 2023
90e976b
docs: sync icon
stydxm Mar 18, 2023
66581f7
docs: add title
stydxm Mar 18, 2023
22b2560
docs: fix some typo errors
DreamOfIce Mar 18, 2023
cdd0a92
docs: translate es std to Chinese
stydxm Mar 18, 2023
79b2420
docs: translate helper feature to Chinese
stydxm Mar 18, 2023
a2eb3ae
docs: translate web std to Chinese
stydxm Mar 19, 2023
1e5df43
docs: fix broken link
stydxm Mar 19, 2023
17c64dc
docs: fix Chinese typo
stydxm Mar 19, 2023
e3453c9
docs: fix broken link
stydxm Mar 20, 2023
eb9c550
docs: add missing para title
stydxm Mar 20, 2023
5ee3bea
docs: add missing front matter
stydxm Mar 20, 2023
e1fbd65
docs: fix broken links
stydxm Mar 20, 2023
1d0a680
docs: translate es proposal to Chinese
stydxm Mar 20, 2023
637395a
docs: differentiate same title
stydxm Mar 20, 2023
29db815
docs: update es proposal's Chinese index
stydxm Mar 20, 2023
fb50615
docs: fix broken link
stydxm Mar 20, 2023
37acb07
chore: ignore dist
stydxm Mar 21, 2023
cfb4935
chore: update dependencies & small changes
stydxm Mar 21, 2023
b2d423b
docs: auto redirect to browser language
stydxm Mar 22, 2023
1abd297
docs: translate roadmap to Chinese & improvements
stydxm Mar 24, 2023
b397f34
docs: polish documents
stydxm Mar 24, 2023
e7c036c
docs: polish documents
stydxm Mar 25, 2023
2f5aa3f
docs: translate title to Chinese
stydxm Mar 25, 2023
a945a57
docs: change homepage style
stydxm Mar 25, 2023
4d4252b
docs: sync changes
stydxm Mar 25, 2023
7b8e4e4
docs: update homepage
stydxm Mar 25, 2023
d0cf6be
docs: fix some types
DreamOfIce Mar 26, 2023
fe3ff04
docs: fix some broken types
DreamOfIce Mar 26, 2023
efa3e45
docs: use SVG logos
DreamOfIce Mar 26, 2023
73ea6f5
docs: add i18n plugin
DreamOfIce Mar 26, 2023
3ddc3a5
docs: update some types
DreamOfIce Mar 27, 2023
6dc870e
docs: fix some types
DreamOfIce Mar 27, 2023
cd1850e
chore(docs): bump vuepress-plugin-i18n to 0.2.0
DreamOfIce Mar 27, 2023
db2c74e
chore: merge upstream changes
stydxm Mar 27, 2023
af0d61c
docs: make title shorter
stydxm Mar 27, 2023
30cd578
docs: sync changes
stydxm Mar 28, 2023
891a3c1
chore(docs): upgrade vuepress-plugin-i18n
DreamOfIce Mar 28, 2023
4e28bec
chore(docs): upgrade vuepress-plugin-i18n
DreamOfIce Mar 28, 2023
80c3bb8
docs: fix some errors
DreamOfIce Mar 30, 2023
e905f2b
docs: update types
DreamOfIce Mar 30, 2023
22e40fc
docs: update string.prototype.replaceAll()
DreamOfIce Mar 31, 2023
c36aef5
chore(docs): upgrade vuepress-plugin-i18n to 0.3.0
DreamOfIce Mar 31, 2023
a5b9c55
chore(docs): upgrade vuepress-theme-hope to 2.0.0-beta.200
DreamOfIce Mar 31, 2023
65d2519
chore(docs): fix a dependency error
DreamOfIce Mar 31, 2023
8295619
chore: merge upstream changes
stydxm Mar 31, 2023
7096c67
docs: sync changes
stydxm Mar 31, 2023
93fdd66
docs: fix typo
stydxm Mar 31, 2023
d4c55da
bugfix: fix multi calls caused by Git merge
stydxm Mar 31, 2023
b2a4176
Merge pull request #1 from stydxm/master
DreamOfIce Apr 1, 2023
c06c672
docs: fix a typo error in Chinese translation
DreamOfIce Apr 1, 2023
537886f
docs: fix include error
DreamOfIce Apr 1, 2023
72491a4
docs: move /en/ to /
DreamOfIce Apr 1, 2023
1f0333c
docs: update navbar
DreamOfIce Apr 1, 2023
a2e0732
Merge remote-tracking branch 'upstream/master'
DreamOfIce Apr 3, 2023
4f18763
docs: add security page
DreamOfIce Apr 3, 2023
c720bc0
chore: merge upstream changes
stydxm Apr 4, 2023
63a1703
Merge remote-tracking branch 'upstream/master'
DreamOfIce Apr 4, 2023
8f310fc
docs: add sponsor logos and backer avatars
stydxm Apr 4, 2023
db48458
docs: optimise sponsor display
DreamOfIce Apr 5, 2023
6aca051
chore: update deps
DreamOfIce Apr 5, 2023
6b5285c
docs: update readme
DreamOfIce Apr 5, 2023
96cedf4
chore: update deps
DreamOfIce Apr 5, 2023
bb5f77a
docs: fix an error in readme
DreamOfIce Apr 5, 2023
9b9bfa0
chore: fox a typo error in readme
DreamOfIce Apr 5, 2023
e3c496f
docs: update docs
DreamOfIce Apr 8, 2023
e3f26da
chore(docs): update deps and format docs
DreamOfIce Apr 10, 2023
063662f
docs: update security.md
DreamOfIce Apr 10, 2023
3d6e56a
docs: remove useless files
DreamOfIce Apr 11, 2023
489de93
Merge branches 'master' and 'master' of github.com:DreamOfIce/core-js
DreamOfIce Apr 11, 2023
4994f58
docs: update docs
DreamOfIce Apr 16, 2023
6a3438b
chore(docs): update deps
DreamOfIce Apr 19, 2023
1143be3
docs: fix a typo error
DreamOfIce Apr 20, 2023
5c4134e
chore: update package-lock.json
DreamOfIce Apr 20, 2023
0df266a
Merge branch 'master' of github.com:DreamOfIce/core-js
DreamOfIce Apr 20, 2023
f981342
Merge remote-tracking branch 'upstream/master'
DreamOfIce Apr 21, 2023
a0a2573
docs: update core-js version
DreamOfIce Apr 21, 2023
0d6f09f
docs: update core-js version
DreamOfIce Apr 22, 2023
9b426c1
chore(docs): update deps
DreamOfIce Apr 23, 2023
4bd7141
chore(docs): update deps
DreamOfIce Apr 25, 2023
7fc81d0
chore(docs): uodate deps
DreamOfIce Apr 28, 2023
798efbd
docs: auto replacement of version number
DreamOfIce Apr 29, 2023
3694fa8
chore(docs): update reps
DreamOfIce May 11, 2023
0c26003
chore(docs): update deps
DreamOfIce May 12, 2023
8e18c4a
docs: update tranlation guide
DreamOfIce May 19, 2023
b017a53
Merge remote-tracking branch 'upstream/master'
DreamOfIce May 20, 2023
ad3ba3e
chore: update package-lock.json
DreamOfIce May 20, 2023
afe5b23
docs: use webp instead of png
DreamOfIce May 20, 2023
9771a93
chore: merge remote-tracking branch 'upstream/master'
DreamOfIce Jul 8, 2023
465112c
chore(docs): sync docs changes
DreamOfIce Jul 9, 2023
4e7f101
chore: update deps
DreamOfIce Jul 9, 2023
2684bc1
chore: fix a typo
DreamOfIce Sep 26, 2023
4f0f0d3
chore: update deps
DreamOfIce Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
@@ -1 +1,7 @@
* text eol=lf
# images
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -42,3 +42,8 @@ node_modules/
/tests/compat/compat-data.js
/tests/unit-global/index.js
/tests/unit-pure/index.js

# VuePress
/docs/.vuepress/.temp
/docs/.vuepress/.cache
/docs/.vuepress/dist
132 changes: 1 addition & 131 deletions CONTRIBUTING.md
Expand Up @@ -2,134 +2,4 @@

Contributions are always welcome. Feel free to ask [**@zloirock**](https://github.com/zloirock) if you have some questions.

## I want to help with code, but I don't know how

There is always some ["help wanted" issues](https://github.com/zloirock/core-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22). You can look at them first. Sure, other help is also required - you could ask [**@zloirock**](https://github.com/zloirock) about it or open issues if you have some ideas.

## How to add a new polyfill

- The polyfill implementation should be added to the [`packages/core-js/modules`](./packages/core-js/modules) directory.
- Shared helpers should be added to the [`packages/core-js/internals`](./packages/core-js/internals) directory. Reuse already existing helpers.
- For export the polyfill, in all common cases use `internals/export` helper. Use something else only if this helper is not applicable - for example, if you want to polyfill accessors.
- If the code of the pure version implementation should significantly differ from the global version (*that's not a frequent situation, in most cases `internals/is-pure` is enough*), you can add it to [`packages/core-js-pure/override`](./packages/core-js-pure/override) directory. The rest parts of `core-js-pure` will be copied from `core-js` package.
- Add the feature detection of the polyfill to [`tests/compat/tests.js`](./tests/compat/tests.js), add the compatibility data to [`packages/core-js-compat/src/data.mjs`](./packages/core-js-compat/src/data.mjs), how to do it [see below](#how-to-update-core-js-compat-data), and the name of the polyfill module to [`packages/core-js-compat/src/modules-by-versions.mjs`](./packages/core-js-compat/src/modules-by-versions.mjs) (this data is also used for getting the default list of polyfills at bundling and generation indexes).
- Add it to entry points where it's required: directories [`packages/core-js/es`](./packages/core-js/es), [`packages/core-js/stable`](./packages/core-js/stable), [`packages/core-js/actual`](./packages/core-js/actual), [`packages/core-js/full`](./packages/core-js/full), [`packages/core-js/proposals`](./packages/core-js/proposals), [`packages/core-js/stage`](./packages/core-js/stage) and [`packages/core-js/web`](./packages/core-js/web).
- Add unit tests to [`tests/unit-global`](./tests/unit-global) and [`tests/unit-pure`](./tests/unit-pure).
- Add tests of entry points to [`tests/entries/unit.mjs`](./tests/entries/unit.mjs).
- Make sure that you are following [our coding style](#style-and-standards) and [all tests](#testing) are passed.
- Document it in [README.md](./README.md) and [CHANGELOG.md](./CHANGELOG.md).

## How to update `core-js-compat` data

For updating `core-js-compat` data:

- If you want to add a new data for a browser, run in this browser `tests/compat/index.html` (tests and results for the actual release are available at [`http://zloirock.github.io/core-js/compat/`](http://zloirock.github.io/core-js/compat/)) and you will see what `core-js` modules are required for this browser.

![compat-table](https://user-images.githubusercontent.com/2213682/217452234-ccdcfc5a-c7d3-40d1-ab3f-86902315b8c3.png)

- If you want to add new data for NodeJS, run `npm run compat-node` with the installed required NodeJS version and you will see the results in the console. Use `npm run compat-node json` if you want to get the result as JSON.
- If you want to add new data for Deno, run `npm run compat-deno` with the installed required Deno version and you will see the results in the console. Use `npm run compat-deno json` if you want to get the result as JSON.
- If you want to add new data for Bun, run `npm run compat-bun` with the installed required Bun version and you will see the results in the console.
- If you want to add new data for Rhino, set the required Rhino version in `compat-rhino` NPM script in [`package.json`](./package.json), run `npm run compat-rhino` and you will see the results in the console.
- If you want to add new data for Hermes (incl. shipped with React Native), run `npm run compat-hermes YOR_PATH_TO_HERMES` and you will see the results in the console.
- After getting this data, add it to [`packages/core-js-compat/src/data.mjs`](./packages/core-js-compat/src/data.mjs).
- If you want to add new mapping (for example, to add a new iOS Safari version based on Safari or NodeJS based on Chrome), add it to [`packages/core-js-compat/src/mapping.mjs`](./packages/core-js-compat/src/mapping.mjs).

engine | how to run tests | base data inherits from | mandatory check | mapping for a new version
--- | --- | --- | --- | ---
`android` | browser runner | `chrome`, `chrome-android` | |
`bun` | bun runner | `safari` (only ES) | required |
`chrome` | browser runner | | required |
`chrome-android` | browser runner | `chrome` | |
`deno` | deno runner | `chrome` (only ES) | non-ES features | required
`edge` | browser runner | `ie`, `chrome` | required (<= 18) |
`electron` | browser runner | `chrome` | | required
`firefox` | browser runner | | required |
`firefox-android` | browser runner | `firefox` | |
`hermes` | hermes runner | | required |
`ie` | browser runner | | required |
`ios` | browser runner | `safari` | | if inconsistent (!= `safari`)
`node` | node runner | `chrome` (only ES) | non-ES features | required
`opera` | browser runner | `chrome` | | if inconsistent (!= `chrome` - 14)
`opera-android` | browser runner | `opera`, `chrome-android` | | required
`phantom` | browser runner | `safari` | |
`quest` | browser runner | `chrome-android` | | required
`react-native` | hermes runner | `hermes` | required |
`rhino` | rhino runner | | required |
`safari` | browser runner | | required |
`samsung` | browser runner | `chrome-android` | | required

If you have no access to all required browsers / versions of browsers, use [Sauce Labs](https://saucelabs.com/), [BrowserStack](https://www.browserstack.com/) or [Cloud Browser](https://ieonchrome.com/).

## Style and standards

The coding style should follow our [`eslint.config.js`](./tests/eslint/eslint.config.js). You can test it by calling [`npm run lint`](#testing). Different places have different syntax and standard library limitations:
- Polyfill implementations should use only ES3 syntax and standard library, they should not use other polyfills from the global scope.
- Unit tests should use the modern syntax with our [minimalistic Babel config](./babel.config.js). Unit tests for the pure version should not use any modern standard library features.
- Tools, scripts and tests, performed in NodeJS, should use only the syntax and the standard library available in NodeJS 8.

File names should be in the kebab-case. Name of polyfill modules should follow the naming convention `namespace.subnamespace-where-required.feature-name`, for example, `esnext.set.intersection`. The top-level namespace should be `es` for stable ECMAScript features, `esnext` for ECMAScript proposals and `web` for other web standards.

## Testing

Before testing, you should install dependencies:
```sh
npm i
```
You can run the most tests by
```sh
npm t
```
You can run parts of the test case separately:
- Linting:
```sh
npm run lint
```
- Unit test case in Karma (modern Chromium, Firefox, WebKit (Playwright) and ancient WebKit (PhantomJS)):
```sh
npx run-s prepare bundle test-unit-karma
```
- Unit test case in NodeJS:
```sh
npx run-s prepare bundle test-unit-node
```
- Unit test case in Bun (it's not included in `npm t` since required installed Bun):
```sh
npx run-s prepare bundle test-unit-bun
```
- [Test262](https://github.com/tc39/test262) test case (it's not included to the default tests):
```sh
npx run-s prepare bundle-package test262
```
- [Promises/A+](https://github.com/promises-aplus/promises-tests) and [ES6 `Promise`](https://github.com/promises-es6/promises-es6) test cases:
```sh
npx run-s prepare test-promises
```
- [ECMAScript `Observable` test case](https://github.com/tc39/proposal-observable):
```sh
npx run-s prepare test-observables
```
- CommonJS entry points tests:
```sh
npx run-s prepare test-entries
```
- `core-js-compat` tools tests:
```sh
npx run-s prepare test-compat-tools
```
- `core-js-builder` tests:
```sh
npx run-s prepare test-builder
```
- If you want to run tests in a certain browser, at first, you should build packages and test bundles:
```sh
npx run-s prepare bundle
```
- For running the global version of the unit test case, use this file:
```sh
tests/unit-browser/global.html
```
- For running the pure version of the unit test case, use this file:
```sh
tests/unit-browser/pure.html
```
For more information please see the [Contribute guide](https://corejs-doc.netlify.app/dev/)