Skip to content

Commit d313775

Browse files
authored
Merge pull request #163 from rollup/sync-f5c349e5
docs(en): merge rollup/master into rollup-docs-cn/master @ f5c349e
2 parents 3b2c8eb + 96bb29b commit d313775

File tree

14 files changed

+74
-49
lines changed

14 files changed

+74
-49
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# rollup changelog
22

3+
## 4.29.2
4+
5+
_2025-01-05_
6+
7+
### Bug Fixes
8+
9+
- Keep import attributes when using dynamic ESM `import()` expressions from CommonJS (#5781)
10+
11+
### Pull Requests
12+
13+
- [#5772](https://github.com/rollup/rollup/pull/5772): Improve caching on CI (@lukastaegert)
14+
- [#5773](https://github.com/rollup/rollup/pull/5773): fix(deps): lock file maintenance minor/patch updates (@renovate[bot])
15+
- [#5780](https://github.com/rollup/rollup/pull/5780): feat: use picocolors instead of colorette (@re-taro)
16+
- [#5781](https://github.com/rollup/rollup/pull/5781): fix: keep import attributes for cjs format (@TrickyPi)
17+
318
## 4.29.1
419

520
_2024-12-21_

LICENSE.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,6 @@ Repository: git+https://github.com/paulmillr/chokidar.git
190190
191191
---------------------------------------
192192

193-
## colorette
194-
License: MIT
195-
By: Jorge Bucaran
196-
Repository: jorgebucaran/colorette
197-
198-
> Copyright © Jorge Bucaran <<https://jorgebucaran.com>>
199-
>
200-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
201-
>
202-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
203-
>
204-
> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
205-
206-
---------------------------------------
207-
208193
## date-time
209194
License: MIT
210195
By: Sindre Sorhus
@@ -470,6 +455,29 @@ Repository: sindresorhus/parse-ms
470455
471456
---------------------------------------
472457

458+
## picocolors
459+
License: ISC
460+
By: Alexey Raspopov
461+
Repository: alexeyraspopov/picocolors
462+
463+
> ISC License
464+
>
465+
> Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
466+
>
467+
> Permission to use, copy, modify, and/or distribute this software for any
468+
> purpose with or without fee is hereby granted, provided that the above
469+
> copyright notice and this permission notice appear in all copies.
470+
>
471+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
472+
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
473+
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
474+
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
475+
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
476+
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
477+
> OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
478+
479+
---------------------------------------
480+
473481
## picomatch
474482
License: MIT
475483
By: Jon Schlinkert

browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rollup/browser",
3-
"version": "4.29.1",
3+
"version": "4.29.2",
44
"description": "Next-generation ES module bundler browser build",
55
"main": "dist/rollup.browser.js",
66
"module": "dist/es/rollup.browser.js",

cli/run/batchWarnings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { blue, cyan } from 'colorette';
1+
import pc from 'picocolors';
22
import type { RollupLog } from '../../src/rollup/types';
33
import { bold, gray, yellow } from '../../src/utils/colors';
44
import { ensureArray } from '../../src/utils/ensureArray';
@@ -72,14 +72,14 @@ export default function batchWarnings(command: Record<string, any>): BatchWarnin
7272
}
7373
case LOGLEVEL_DEBUG: {
7474
if (!silent) {
75-
stderr(bold(blue(log.message)));
75+
stderr(bold(pc.blue(log.message)));
7676
defaultBody(log);
7777
}
7878
return;
7979
}
8080
default: {
8181
if (!silent) {
82-
stderr(bold(cyan(log.message)));
82+
stderr(bold(pc.cyan(log.message)));
8383
defaultBody(log);
8484
}
8585
}

docs/configuration-options/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ Promise.resolve()
928928
| CLI: | `--externalImportAttributes`/`--no-externalImportAttributes` |
929929
| 默认: | `true` |
930930

931-
是否在输出中为外部引入添加导入属性,如果输出格式为 `es`。默认情况下,属性来自输入文件,但插件可以稍后添加或删除属性。例如,`import "foo" assert {type: "json"}` 将导致相同的导入出现在输出中,除非将该选项设置为 `false`。请注意,模块的所有导入都需要具有一致的属性,否则会发出警告。
931+
是否在输出格式为 `es``cjs` 时,在输出中为外部引入添加导入属性。默认情况下,属性是从输入文件中获取的,但插件可以在后面添加或删除属性。例如,`import "foo" assert {type: "json"}` 将导致相同的导入出现在输出中,除非该选项设置为 `false`。请注意,一个模块的所有导入需要具有一致的属性,否则会发出警告。
932932

933933
### output.generatedCode {#output-generatedcode}
934934

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup",
3-
"version": "4.29.1",
3+
"version": "4.29.2",
44
"description": "Next-generation ES module bundler",
55
"main": "dist/rollup.js",
66
"module": "dist/es/rollup.js",
@@ -150,7 +150,6 @@
150150
"buble": "^0.20.0",
151151
"builtin-modules": "^4.0.0",
152152
"chokidar": "^3.6.0",
153-
"colorette": "^2.0.20",
154153
"concurrently": "^9.1.0",
155154
"core-js": "3.38.1",
156155
"cross-env": "^7.0.3",
@@ -176,6 +175,7 @@
176175
"nodemon": "^3.1.9",
177176
"npm-audit-resolver": "^3.0.0-RC.0",
178177
"nyc": "^17.1.0",
178+
"picocolors": "^1.1.1",
179179
"pinia": "^2.3.0",
180180
"prettier": "^3.4.2",
181181
"prettier-plugin-organize-imports": "^4.1.0",

scripts/colors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { createColors } from 'colorette';
21
import { env } from 'node:process';
2+
import pc from 'picocolors';
33

44
// @see https://no-color.org
55
// @see https://www.npmjs.com/package/chalk
6-
export const { bold, cyan, green, red, yellow, blue, magenta } = createColors({
7-
useColor: env.FORCE_COLOR !== '0' && !env.NO_COLOR
8-
});
6+
export const { bold, cyan, green, red, yellow, blue, magenta } = pc.createColors(
7+
env.FORCE_COLOR !== '0' && !env.NO_COLOR
8+
);

scripts/perf-report/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* global gc */
22

3-
import { createColors } from 'colorette';
43
import { mkdir, symlink, writeFile } from 'node:fs/promises';
54
import { chdir } from 'node:process';
65
import { fileURLToPath } from 'node:url';
6+
import pc from 'picocolors';
77
import prettyBytes from 'pretty-bytes';
88
import { runWithEcho } from '../helpers.js';
99
import reportCollector from './report-collector.js';
@@ -20,7 +20,7 @@ import { newRollup, previousRollup, previousVersion } from './rollup-artefacts.j
2020
const PERF_DIRECTORY = new URL('../../perf/', import.meta.url);
2121
const ENTRY = new URL('entry.js', PERF_DIRECTORY);
2222
const THREEJS_COPIES = 10;
23-
const { bold, underline, cyan, red, green } = createColors();
23+
const { bold, underline, cyan, red, green } = pc.createColors();
2424
const MIN_ABSOLUTE_TIME_DEVIATION = 10;
2525
const MIN_RELATIVE_DEVIATION_PERCENT = 2;
2626
const RELATIVE_DEVIATION_PERCENT_FOR_COLORING = 5;

src/Chunk.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,9 @@ export default class Chunk {
966966
}
967967
return [
968968
resolution || '',
969-
(this.outputOptions.format === 'es' && this.outputOptions.externalImportAttributes) || null
969+
(['es', 'cjs'].includes(this.outputOptions.format) &&
970+
this.outputOptions.externalImportAttributes) ||
971+
null
970972
];
971973
}
972974

0 commit comments

Comments
 (0)