Skip to content

Commit

Permalink
docs(en): merging all conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
docschina-bot committed Aug 19, 2024
2 parents 267db5e + 262a388 commit 8b9cc15
Show file tree
Hide file tree
Showing 127 changed files with 1,694 additions and 2,546 deletions.
165 changes: 0 additions & 165 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.{ts,js}': ['eslint --fix --cache'],
'*.md': ['prettier --write'],
'*.{ts,js}': ['eslint --fix --cache']
};
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"proseWrap": "never"
}
}
]
],
"plugins": ["prettier-plugin-organize-imports"]
}
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# rollup changelog

## 4.21.0

_2024-08-18_

### Features

- Add option to configure directory for virtual modules when preserving modules (#5602)

### Pull Requests

- [#5602](https://github.com/rollup/rollup/pull/5602): feat: introduce the virtualDirname option to customize the virtual directory name (@TrickyPi)
- [#5607](https://github.com/rollup/rollup/pull/5607): chore(deps): update typescript-eslint monorepo to v8 (major) (@renovate[bot], @lukastaegert)
- [#5608](https://github.com/rollup/rollup/pull/5608): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5611](https://github.com/rollup/rollup/pull/5611): chore: fix the `noConflict` option in REPL. (@7086cmd)
- [#5613](https://github.com/rollup/rollup/pull/5613): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
- [#5614](https://github.com/rollup/rollup/pull/5614): chore(deps): lock file maintenance (@renovate[bot])

## 4.20.0

_2024-08-03_

### Features

- Allow plugins to specify the original file name when emitting assets (#5596)

### Pull Requests

- [#5596](https://github.com/rollup/rollup/pull/5596): Add originalFIleName property to emitted assets (@lukastaegert)
- [#5599](https://github.com/rollup/rollup/pull/5599): chore(deps): update dependency eslint-plugin-unicorn to v55 (@renovate[bot], @lukastaegert)
- [#5600](https://github.com/rollup/rollup/pull/5600): chore(deps): lock file maintenance minor/patch updates (@renovate[bot], @lukastaegert)

## 4.19.2

_2024-08-01_
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": "4.19.2",
"version": "4.21.0",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
1 change: 0 additions & 1 deletion browser/src/initWasm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-unresolved
import init from '../../wasm/bindings_wasm';

export default async function initWasm() {
Expand Down
5 changes: 2 additions & 3 deletions browser/src/wasm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// eslint-disable-next-line import/no-unresolved
export { parse, xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../wasm/bindings_wasm.js';
export { parse, xxhashBase16, xxhashBase36, xxhashBase64Url } from '../../wasm/bindings_wasm.js';

// eslint-disable-next-line import/no-unresolved
import { parse } from '../../wasm/bindings_wasm.js';

export async function parseAsync(
code: string,
allowReturnOutsideFunction: boolean,
Expand Down
2 changes: 1 addition & 1 deletion build-plugins/fs-events-replacement.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RollupReplaceOptions } from '@rollup/plugin-replace';
import { readFile } from 'node:fs/promises';
import { exit } from 'node:process';
import type { RollupReplaceOptions } from '@rollup/plugin-replace';

const FSEVENTS_HANDLER = 'node_modules/chokidar/lib/fsevents-handler.js';
const FSEVENTS_REQUIRE = "require('fsevents')";
Expand Down
5 changes: 2 additions & 3 deletions cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import process from 'node:process';
import help from 'help.md';
import process from 'node:process';
import { version } from 'package.json';
import argParser from 'yargs-parser';
import { commandAliases } from '../src/utils/options/mergeOptions';
Expand All @@ -17,15 +17,14 @@ if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) {
console.log(`rollup v${version}`);
} else {
try {
// eslint-disable-next-line unicorn/prefer-module
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('source-map-support').install();
} catch {
// do nothing
}

const promise = run(command);
if (command.forceExit) {
// eslint-disable-next-line unicorn/no-process-exit
promise.then(() => process.exit());
}
}
8 changes: 2 additions & 6 deletions cli/run/batchWarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ export default function batchWarnings(command: Record<string, any>): BatchWarnin
};
}

const immediateHandlers: {
[code: string]: (warning: RollupLog) => void;
} = {
const immediateHandlers: Record<string, (warning: RollupLog) => void> = {
MISSING_NODE_BUILTINS(warning) {
title(`Missing shims for Node.js built-ins`);

Expand All @@ -111,9 +109,7 @@ const immediateHandlers: {
}
};

const deferredHandlers: {
[code: string]: (warnings: RollupLog[]) => void;
} = {
const deferredHandlers: Record<string, (warnings: RollupLog[]) => void> = {
CIRCULAR_DEPENDENCY(warnings) {
title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`);
const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
Expand Down
2 changes: 1 addition & 1 deletion cli/run/commandPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function getCamelizedPluginBaseName(pluginText: string): string {

async function requireOrImport(pluginPath: string): Promise<any> {
try {
// eslint-disable-next-line unicorn/prefer-module
// eslint-disable-next-line @typescript-eslint/no-require-imports
return require(pluginPath);
} catch {
return import(pluginPath);
Expand Down
2 changes: 0 additions & 2 deletions cli/run/getConfigPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ export async function getConfigPath(commandConfig: string | true): Promise<strin
if (commandConfig.slice(0, 5) === 'node:') {
const packageName = commandConfig.slice(5);
try {
// eslint-disable-next-line unicorn/prefer-module
return require.resolve(`rollup-config-${packageName}`, { paths: [cwd()] });
} catch {
try {
// eslint-disable-next-line unicorn/prefer-module
return require.resolve(packageName, { paths: [cwd()] });
} catch (error: any) {
if (error.code === 'MODULE_NOT_FOUND') {
Expand Down
4 changes: 2 additions & 2 deletions cli/run/watch-cli.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import type { FSWatcher } from 'chokidar';
import chokidar from 'chokidar';
import dateTime from 'date-time';
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import ms from 'pretty-ms';
import { onExit } from 'signal-exit';
import * as rollup from '../../src/node-entry';
Expand Down
2 changes: 0 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// eslint-disable-next-line import/no-unresolved
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client';
import '@shikijs/vitepress-twoslash/style.css';
import { createPinia } from 'pinia';
// eslint-disable-next-line import/no-unresolved
import defaultTheme from 'vitepress/theme';
import './custom.css';
import './styles/font.css';
Expand Down
21 changes: 20 additions & 1 deletion docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ export default {

```typescript
interface PreRenderedAsset {
name?: string;
name: string | undefined;
originalFileName: string | null;
source: string | Uint8Array;
type: 'asset';
}
Expand Down Expand Up @@ -1471,7 +1472,11 @@ define(['https://d3js.org/d3.v4.min'], function (d3) {
| CLI: | `--preserveModules`/`--no-preserveModules` |
| 默认: | `false` |

<<<<<<< HEAD
该选项将使用原始模块名作为文件名,为所有模块创建单独的 chunk,而不是创建尽可能少的 chunk。它需要配合 [`output.dir`](#output-dir) 选项一起使用。除屑优化(Tree-shaking)仍会对没有被入口使用或者执行阶段没有副作用的文件生效,并删除不属于入口起点的未使用文件的导出。另一方面,如果插件(如 `@rollup/plugin-commonjs`)为实现某些结果而产生了额外的“虚拟”文件,这些文件将作为实际文件使用 `_virtual/fileName.js` 模式产生。
=======
Instead of creating as few chunks as possible, this mode will create separate chunks for all modules using the original module names as file names. Requires the [`output.dir`](#output-dir) option. Tree-shaking will still be applied, suppressing files that are not used by the provided entry points or do not have side effects when executed and removing unused exports of files that are not entry points. On the other hand, if plugins (like `@rollup/plugin-commonjs`) emit additional "virtual" files to achieve certain results, those files will be emitted as actual files using a pattern [`${output.virtualDirname}/fileName.js`](#output-virtualdirname).
>>>>>>> 262a38850870a0ef585aaa093883025dcd389d65
因此,如果你直接想从这些文件中引入,不建议盲目地使用这个选项将整个文件结构转换为另一种格式,因为预期的输出可能会丢失。在这种情况下,你应该把所有文件明确指定为入口,把它们添加到 [`input` 选项对象](#input) 中,可以查看那里的例子。

Expand Down Expand Up @@ -1681,7 +1686,21 @@ export default {

如果代码是无效的,将抛出警告。请注意,如果没有错误被抛出,你就可以检查输出代码。要把这个警告提升为错误,你可以在 [`onwarn`](#onwarn) 中查询。

<<<<<<< HEAD
### preserveEntrySignatures {#preserveentrysignatures}
=======
### output.virtualDirname

| | |
| -------: | :--------------------------- |
| Type: | `string` |
| CLI: | `--virtualDirname <dirname>` |
| Default: | `_virtual` |

This option specifies the directory name for "virtual" files that might be emitted by plugins (like `@rollup/plugin-commonjs`). It is only validated when [`output.preserveModules`](#output-preservemodules) is enabled.

### preserveEntrySignatures
>>>>>>> 262a38850870a0ef585aaa093883025dcd389d65
| | |
| --: | :-- |
Expand Down
Loading

0 comments on commit 8b9cc15

Please sign in to comment.