Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Sep 10, 2023
2 parents 4fff11d + e9fef3f commit d3af65f
Show file tree
Hide file tree
Showing 66 changed files with 818 additions and 433 deletions.
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
44 changes: 41 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 rollup-swc
if: ${{github.head_ref == 'rollup-swc'}}
with:
toolchain: nightly
targets: x86_64-unknown-linux-gnu
- name: Cache cargo
uses: actions/cache@v3
#TODO: remove after or before merging rollup-swc
if: ${{github.head_ref == 'rollup-swc'}}
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 rollup-swc
if: ${{ github.head_ref == 'rollup-swc' }}
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 rollup-swc
- name: Build artefacts
if: ${{ github.head_ref != 'rollup-swc' }}
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 rollup-swc
if: ${{github.head_ref == 'rollup-swc'}}
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 Down
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# rollup changelog

## 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
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.0",
"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 @@ Many options have command line equivalents. In those cases, any arguments passed
--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
16 changes: 16 additions & 0 deletions docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,22 @@ The location of the generated bundle. If this is an absolute path, all the `sour

`sourcemapFile` is not required if `output` is specified, in which case an output filename will be inferred by adding ".map" to the output filename for the bundle.

### output.sourcemapFileNames

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

The pattern to use for sourcemaps, or a function that is called per sourcemap to return such a pattern. Patterns support the following placeholders:

- `[format]`: The rendering format defined in the output options, e.g. `es` or `cjs`.
- `[hash]`: A hash based only on the content of the final generated sourcemap. You can also set a specific hash length via e.g. `[hash:10]`.
- `[chunkhash]`: The same hash as the one used for the corresponding generated chunk (if any).
- `[name]`: The file name (without extension) of the entry point, unless the object form of input was used to define a different name.

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

| | |
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
22 changes: 14 additions & 8 deletions docs/repl/stores/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,14 @@ export const useOptions = defineStore('options2', () => {
available: optionOutputPreserveModules.value,
name: 'output.preserveModulesRoot'
});
const optionOutputSourcemap = getBoolean({
name: 'output.sourcemap'
});
const optionOutputSanitizeFileName = getBoolean({
available: alwaysTrue,
defaultValue: true,
name: 'output.sanitizeFileName'
});
const optionOutputSourcemap = getBoolean({
name: 'output.sourcemap'
});
const optionOutputSourcemapBaseUrl = getString({
available: optionOutputSourcemap.value,
name: 'output.sourcemapBaseUrl'
Expand All @@ -327,12 +327,22 @@ export const useOptions = defineStore('options2', () => {
available: optionOutputSourcemap.value,
name: 'output.sourcemapExcludeSources'
});
const optionOutputSourcemapFileNames = getString({
available: alwaysTrue,
defaultValue: undefined,
name: 'output.sourcemapFileNames'
});
const optionOutputStrict = getBoolean({
available: () =>
optionOutputFormat.value.value !== undefined && optionOutputFormat.value.value !== 'es',
defaultValue: true,
name: 'output.strict'
});
const optionOutputSystemNullSetters = getBoolean({
available: () => optionOutputFormat.value.value === 'system',
defaultValue: true,
name: 'output.systemNullSetters'
});
const optionOutputValidate = getBoolean({
name: 'output.validate'
});
Expand All @@ -342,11 +352,6 @@ export const useOptions = defineStore('options2', () => {
name: 'preserveEntrySignatures',
options: () => ['strict', 'allow-extension', 'exports-only', false]
});
const optionOutputSystemNullSetters = getBoolean({
available: () => optionOutputFormat.value.value === 'system',
defaultValue: true,
name: 'output.systemNullSetters'
});
const optionShimMissingExports = getBoolean({
defaultValue: false,
name: 'shimMissingExports'
Expand Down Expand Up @@ -436,6 +441,7 @@ export const useOptions = defineStore('options2', () => {
optionOutputPreserveModules,
optionOutputPreserveModulesRoot,
optionOutputSourcemap,
optionOutputSourcemapFileNames,
optionOutputSanitizeFileName,
optionOutputSourcemapBaseUrl,
optionOutputSourcemapExcludeSources,
Expand Down

0 comments on commit d3af65f

Please sign in to comment.