Skip to content

Commit

Permalink
Merge pull request #67 from rollup/sync-801ffd1a
Browse files Browse the repository at this point in the history
docs(en): merge rollup/master into rollup-docs-cn/master @ 801ffd1
  • Loading branch information
waynzh authored Sep 25, 2023
2 parents dda9dc7 + 008295d commit 1d87e6a
Show file tree
Hide file tree
Showing 93 changed files with 1,173 additions and 817 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = {
'coverage',
'_tmp',
'cache',
'wasm',
'/test/*/samples/**/*.*',
'!/test/*/samples/**/_config.js',
'!/test/*/samples/**/rollup.config.js',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
Expand Down
48 changes: 45 additions & 3 deletions .github/workflows/repl-artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,34 @@ jobs:
upload:
permissions:
pull-requests: write # for peter-evans/find-comment and peter-evans/create-or-update-comment
# TODO SWC re-enable for rollup-swc once it is working
if: ${{ (github.event.pull_request.head.repo.full_name == 'rollup/rollup' || contains( toJson(github.event.pull_request.labels), 'x⁸ ⚙️ build repl artefacts' )) && github.head_ref != 'rollup-swc' }}
if: ${{ github.event.pull_request.head.repo.full_name == 'rollup/rollup' || contains( toJson(github.event.pull_request.labels), 'x⁸ ⚙️ build repl artefacts' ) }}
runs-on: ubuntu-latest
name: Upload
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Install Toolchain
uses: dtolnay/rust-toolchain@stable
#TODO: remove after or before merging release-4.0
if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }}
with:
toolchain: nightly
targets: x86_64-unknown-linux-gnu
- name: Cache cargo
uses: actions/cache@v3
#TODO: remove after or before merging release-4.0
if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }}
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
rust/target/
key: cargo-cache-${{ hashFiles('rust/Cargo.lock') }}
restore-keys: cargo-cache
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand All @@ -38,6 +57,12 @@ jobs:
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts
- name: Build artefacts
#TODO: remove after or before merging release-4.0
if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }}
run: npm exec -- concurrently -c green,blue,yellow 'npm:build:napi -- --release' 'npm run build:wasm' 'npm:build:cjs' && npm run build:copy-native && npm run build:bootstrap
#TODO: remove after or before merging release-4.0
- name: Build artefacts
if: ${{ github.head_ref != 'release-4.0' && github.base_ref != 'release-4.0' }}
run: npm run build:cjs && npm run build:bootstrap
- name: Upload "${{ github.event.number }}/rollup.browser.js" to bucket
uses: zdurham/s3-upload-github-action@master
Expand All @@ -61,6 +86,19 @@ jobs:
S3_KEY: ${{ github.event.number }}/rollup.browser.js.map
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload "${{ github.event.number }}/bindings_wasm_bg.wasm" to bucket
uses: zdurham/s3-upload-github-action@master
#TODO: remove after or before merging release-4.0
if: ${{ github.head_ref == 'release-4.0' || github.base_ref == 'release-4.0' }}
with:
args: --cache-control max-age=300,public
env:
FILE: browser/dist/bindings_wasm_bg.wasm
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
S3_KEY: ${{ github.event.number }}/bindings_wasm_bg.wasm
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Find Comment
uses: peter-evans/find-comment@v2
id: findComment
Expand All @@ -84,6 +122,8 @@ jobs:
npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
```
Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.
or load it into the REPL:
https://rollupjs.org/repl/?pr=${{ github.event.number }}
- name: Find Vercel preview URL
Expand All @@ -107,5 +147,7 @@ jobs:
npm install ${{ github.event.pull_request.head.repo.full_name }}#${{ github.event.pull_request.head.ref }}
```
Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.
or load it into the REPL:
${{ steps.waitForVercel.outputs.url }}/repl/?pr=${{ github.event.number }}
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Node 18 + Coverage (Linux)
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
name: Node 16 + Extra Tests (Linux)
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
name: Node ${{ matrix.node }} (Linux)
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
name: Node ${{ matrix.node }} (macOS)
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
name: Node ${{ matrix.node }} (Windows)
steps:
- name: Checkout Commit
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# rollup changelog

## 3.29.3

_2023-09-24_

### Bug Fixes

- Fix a bug where code was wrongly tree-shaken after mutating function parameters (#5153)

### Pull Requests

- [#5145](https://github.com/rollup/rollup/pull/5145): docs: improve the docs repl appearance in the light mode (@TrickyPi)
- [#5148](https://github.com/rollup/rollup/pull/5148): chore(deps): update dependency @vue/eslint-config-typescript to v12 (@renovate[bot])
- [#5149](https://github.com/rollup/rollup/pull/5149): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5153](https://github.com/rollup/rollup/pull/5153): Fully deoptimize first level path when deoptimizing nested parameter paths (@lukastaegert)

## 3.29.2

_2023-09-15_

### Bug Fixes

- Export `TreeshakingPreset` type (#5131)

### Pull Requests

- [#5131](https://github.com/rollup/rollup/pull/5131): fix: exports `TreeshakingPreset` (@moltar)
- [#5134](https://github.com/rollup/rollup/pull/5134): docs: steps to enable symlinks on windows (@thebanjomatic)
- [#5137](https://github.com/rollup/rollup/pull/5137): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])

## 3.29.1

_2023-09-10_

### Bug Fixes

- Fix time measurement of plugin hooks in watch mode (#5114)
- Ensure accessing document.currentScript in import.meta.url returns correct results (#5118)

### Pull Requests

- [#5114](https://github.com/rollup/rollup/pull/5114): fix(perf): avoid superfluous timer wrappings in watch mode (@ZhengLiu2825)
- [#5118](https://github.com/rollup/rollup/pull/5118): fix: access document.currentScript at the top level (@TrickyPi)
- [#5125](https://github.com/rollup/rollup/pull/5125): chore(deps): update actions/checkout action to v4 (@renovate[bot])
- [#5126](https://github.com/rollup/rollup/pull/5126): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5129](https://github.com/rollup/rollup/pull/5129): re-enbale repl-artefacts workflow for rollup-swc branch (@TrickyPi)

## 3.29.0

_2023-09-06_

### Features

- Add output.sourcemapFileNames option (#5105)
- Add generic type parameter for `api` to Plugin type (#5112)

### Bug Fixes

- Ensure mutations of CustomEvent details are tracked (#5123)

### Pull Requests

- [#5105](https://github.com/rollup/rollup/pull/5105): Added option to name sourcemap files, i.e. a output.sourcemapFileName… (@atti187)
- [#5108](https://github.com/rollup/rollup/pull/5108): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5109](https://github.com/rollup/rollup/pull/5109): Docs: load full path of rollup.browser.js for Rollup V4 (@TrickyPi)
- [#5112](https://github.com/rollup/rollup/pull/5112): feat(types): add generic type for plugin api (@sxzz)
- [#5115](https://github.com/rollup/rollup/pull/5115): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5123](https://github.com/rollup/rollup/pull/5123): Deoptimize custom event detail (@lukastaegert)

## 3.28.1

_2023-08-22_
Expand Down
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ We welcome any type of contribution, not only code. You can help with

Working on your first Pull Request? You can learn how from this _free_ course, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).

### Git configuration to enable symlinks

The unit tests in this projects make use of symlinks in the git project. On Windows, this may not work as expected without extra configuration. To configure git to create symlinks on windows, you need to enable the Windows "Developer Mode" setting, and also set the `core.symlinks` git feature using either of the following commands:

```bash
# Global setting
git config --global core.symlinks true

# Local setting
git config core.symlinks true
```

After applying this setting, you may need to reset your local branch to ensure the files get rewritten as symlinks. Note that this step is destructive and you will want to push any changes you have made prior to resetting your branch.

```bash
git reset --hard
```

### How to run one test on your local machine

With `npm run test` you can run all tests together.
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/browser",
"version": "3.28.1",
"version": "3.29.3",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
1 change: 1 addition & 0 deletions cli/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Basic options:
--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base
--sourcemapExcludeSources Do not include source code in source maps
--sourcemapFile <file> Specify bundle position for source maps
--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps
--stdin=ext Specify file extension used for stdin input
--no-stdin Do not read "-" from stdin
--no-strict Don't emit `"use strict";` in the generated modules
Expand Down
2 changes: 2 additions & 0 deletions docs/command-line-interface/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default {
sourcemapBaseUrl,
sourcemapExcludeSources,
sourcemapFile,
sourcemapFileNames,
sourcemapIgnoreList,
sourcemapPathTransform,
validate,
Expand Down Expand Up @@ -420,6 +421,7 @@ export default {
--sourcemapBaseUrl <url> 使用给定的基本 URL 发出绝对源映射 URL
--sourcemapExcludeSources 在源映射中不包括源代码
--sourcemapFile <file> 指定源映射的包位置
--sourcemapFileNames <pattern> 编译后 sourcemap 的命名模式
--stdin=ext 指定用于标准输入的文件扩展名
--no-stdin 不要从 stdin 读取 "-"
--no-strict 不在生成的模块中发出 `"use strict";`
Expand Down
18 changes: 18 additions & 0 deletions docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,24 @@ export default {

如果 `output` 设置了值,那么 `sourcemapFile` 不是必须的,这种情况下,它的值会通过输出文件名中添加“.map”推断出来。

### output.sourcemapFileNames

| | |
| ----: | :--------------------------------------------- |
| 类型: | `string \| ((chunkInfo: ChunkInfo) => string)` |
| CLI: | `--sourcemapFileNames <pattern>` |

该选项指定 sourcemap 的模式,或者是一个根据每个 sourcemap 调用以返回此类模式的函数。该模式支持以下占位符:

- `[format]`:在输出选项中定义的渲染格式,例如 `es``cjs`
- `[hash]`:一个仅基于最终生成的 sourcemap 内容的哈希值。也可以通过例如 `[hash:10]` 设置特定的哈希长度。
- `[chunkhash]`:与对应生成的 chunk(如果有的话)使用的哈希值相同。
- `[name]`:除非使用输入的对象形式定义了不同的名称,否则该文件名(不包括扩展名)就是入口起点的名称。

正斜杠 `/` 可以用来将文件放在子目录中。当使用函数时,`chunkInfo` 是 [`generateBundle`](../plugin-development/index.md#generatebundle) 中的简化版本,不包含依赖于文件名的属性,也没有关于渲染模块的信息,因为渲染只在生成文件名之后发生。但是,你可以访问其中的 `moduleIds` 列表。另请参见 [`output.assetFileNames`](#output-assetfilenames),[`output.chunkFileNames`](#output-chunkfilenames)。

Forward slashes `/` can be used to place files in sub-directories. When using a function, `chunkInfo` is a reduced version of the one in [`generateBundle`](../plugin-development/index.md#generatebundle) without properties that depend on file names and no information about the rendered modules as rendering only happens after file names have been generated. You can however access a list of included `moduleIds`. See also [`output.assetFileNames`](#output-assetfilenames), [`output.chunkFileNames`](#output-chunkfilenames).

### output.sourcemapIgnoreList {#output-sourcemapignorelist}

| | |
Expand Down
1 change: 1 addition & 0 deletions docs/javascript-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const outputOptions = {
sourcemapBaseUrl,
sourcemapExcludeSources,
sourcemapFile,
sourcemapFileNames,
sourcemapIgnoreList,
sourcemapPathTransform,
validate,
Expand Down
10 changes: 5 additions & 5 deletions docs/repl/components/ReplModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const selectName = (event: FocusEvent) => {
header {
width: 100%;
color: var(--vp-c-text-dark-1);
color: var(--vp-c-text-1);
position: relative;
font-weight: 600;
}
Expand Down Expand Up @@ -96,13 +96,13 @@ input {
}
input:hover {
border-color: var(--vp-c-gray-dark-2);
background-color: var(--vp-c-gray-dark-3);
border-color: var(--vp-c-gray-2);
background-color: var(--vp-c-gray-3);
}
input:focus {
border-color: var(--vp-c-gray-dark-2);
background-color: var(--vp-c-gray-dark-2);
border-color: var(--vp-c-gray-2);
background-color: var(--vp-c-gray-2);
}
.entry-module input {
Expand Down
2 changes: 1 addition & 1 deletion docs/repl/helpers/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const theme = EditorView.baseTheme({
outline: 'none'
},
'.cm-content': {
caretColor: '#fff',
caretColor: 'var(--vp-c-neutral)',
color: '#A6ACCD',
fontFamily: 'var(--vp-font-family-mono)',
fontSize: '14px',
Expand Down
Loading

1 comment on commit 1d87e6a

@vercel
Copy link

@vercel vercel bot commented on 1d87e6a Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.