Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into node-resolve-modu…
Browse files Browse the repository at this point in the history
…le-paths
  • Loading branch information
shellscape committed Oct 8, 2023
2 parents 825c8de + cdf9113 commit 8f18688
Show file tree
Hide file tree
Showing 94 changed files with 742 additions and 447 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
run: pnpm install --ignore-scripts

- name: run tests
run: pnpm --filter "...[origin/master]" ci:test
run: pnpm --workspace-concurrency 1 --filter "...[origin/master]" ci:test
8 changes: 8 additions & 0 deletions packages/alias/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-alias ChangeLog

## v5.0.1

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v5.0.0

_2023-04-04_
Expand Down
6 changes: 3 additions & 3 deletions packages/alias/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-alias",
"version": "5.0.0",
"version": "5.0.1",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -51,7 +51,7 @@
"alias"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
Expand All @@ -65,7 +65,7 @@
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-typescript": "^9.0.1",
"del-cli": "^5.0.0",
"rollup": "^3.2.3",
"rollup": "^4.0.0-24",
"typescript": "^4.8.3"
},
"types": "./types/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions packages/alias/test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ test('Forwards isEntry and custom options to a custom resolver', (t) => {
{
source: 'nonEntry',
importer: '/src/importer.js',
options: { assertions: {}, isEntry: false, custom: { test: 42 } }
options: { attributes: {}, isEntry: false, custom: { test: 42 } }
}
]
).then((result) => {
Expand All @@ -464,7 +464,7 @@ test('Forwards isEntry and custom options to a custom resolver', (t) => {
'entry-point',
'/src/importer.js',
{
assertions: {},
attributes: {},
custom: void 0,
isEntry: true
}
Expand All @@ -473,7 +473,7 @@ test('Forwards isEntry and custom options to a custom resolver', (t) => {
'non-entry-point',
'/src/importer.js',
{
assertions: {},
attributes: {},
custom: { test: 42 },
isEntry: false
}
Expand Down Expand Up @@ -514,7 +514,7 @@ test('Forwards isEntry and custom options to other plugins', (t) => {
'entry-point',
'/src/importer.js',
{
assertions: {},
attributes: {},
custom: void 0,
isEntry: true
}
Expand All @@ -523,7 +523,7 @@ test('Forwards isEntry and custom options to other plugins', (t) => {
'non-entry-point',
'/src/importer.js',
{
assertions: {},
attributes: {},
custom: { test: 42 },
isEntry: false
}
Expand Down
8 changes: 8 additions & 0 deletions packages/auto-install/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-auto-install ChangeLog

## v3.0.5

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v3.0.4

_2023-04-04_
Expand Down
6 changes: 3 additions & 3 deletions packages/auto-install/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-auto-install",
"version": "3.0.4",
"version": "3.0.5",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -53,7 +53,7 @@
"modules"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
Expand All @@ -65,7 +65,7 @@
"@rollup/plugin-typescript": "^9.0.1",
"del": "^6.1.1",
"node-noop": "^1.0.0",
"rollup": "^3.2.3",
"rollup": "^4.0.0-24",
"typescript": "^4.8.3"
},
"types": "./types/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/babel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-babel ChangeLog

## v6.0.4

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v6.0.3

_2022-11-25_
Expand Down
6 changes: 3 additions & 3 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-babel",
"version": "6.0.3",
"version": "6.0.4",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -55,7 +55,7 @@
"peerDependencies": {
"@babel/core": "^7.0.0",
"@types/babel__core": "^7.1.9",
"rollup": "^1.20.0||^2.0.0||^3.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
Expand All @@ -79,7 +79,7 @@
"@rollup/plugin-json": "^5.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@types/babel__core": "^7.1.9",
"rollup": "^3.2.3",
"rollup": "^4.0.0-24",
"source-map": "^0.7.4"
},
"types": "./types/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel/test/as-output-plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ test('transforms all chunks in a code-splitting setup', async (t) => {
t.deepEqual(
output.map(({ code }) => code),
[
`import('./dep-20aaf50b.js').then(function (result) {
`import('./dep--s88I99N.js').then(function (result) {
return console.log(result);
});
`,
Expand Down
8 changes: 8 additions & 0 deletions packages/beep/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-beep ChangeLog

## v1.0.3

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v1.0.2

_2022-10-21_
Expand Down
6 changes: 3 additions & 3 deletions packages/beep/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-beep",
"version": "1.0.2",
"version": "1.0.3",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -37,15 +37,15 @@
"rollup"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
},
"devDependencies": {
"rollup": "^3.2.3",
"rollup": "^4.0.0-24",
"strip-ansi": "^7.0.1"
},
"types": "types/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/buble/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-buble ChangeLog

## v1.0.3

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v1.0.2

_2023-01-20_
Expand Down
6 changes: 3 additions & 3 deletions packages/buble/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-buble",
"version": "1.0.2",
"version": "1.0.3",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -53,7 +53,7 @@
"modules"
],
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0"
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
Expand All @@ -68,7 +68,7 @@
"devDependencies": {
"@rollup/plugin-typescript": "^9.0.1",
"del-cli": "^5.0.0",
"rollup": "^3.2.3",
"rollup": "^4.0.0-24",
"source-map": "^0.7.4",
"typescript": "^4.8.3"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/commonjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @rollup/plugin-commonjs ChangeLog

## v25.0.5

_2023-10-05_

### Bugfixes

- fix: ensure rollup 4 compatibility [#1595](https://github.com/rollup/plugins/pull/1595)

## v25.0.4

_2023-08-11_
Expand Down
6 changes: 3 additions & 3 deletions packages/commonjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/plugin-commonjs",
"version": "25.0.4",
"version": "25.0.5",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -54,7 +54,7 @@
"require"
],
"peerDependencies": {
"rollup": "^2.68.0||^3.0.0"
"rollup": "^2.68.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
Expand All @@ -74,7 +74,7 @@
"@rollup/plugin-node-resolve": "^15.0.0",
"locate-character": "^2.0.5",
"require-relative": "^0.8.7",
"rollup": "^3.19.0",
"rollup": "^4.0.0-24",
"shx": "^0.3.4",
"source-map": "^0.7.4",
"source-map-support": "^0.5.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/commonjs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export default function commonjs(options = {}) {
try {
return transformAndCheckExports.call(this, code, id);
} catch (err) {
return this.error(err, err.loc);
return this.error(err, err.pos);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/commonjs/src/resolve-require-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export function getRequireResolver(extensions, detectCyclesAndConditional, curre
currentlyResolvingForParent.add(source);
const resolved =
(await rollupContext.resolve(source, parentId, {
skipSelf: false,
custom: { 'node-resolve': { isRequire: true } }
})) || resolveExtensions(source, parentId, extensions);
currentlyResolvingForParent.delete(source);
Expand Down
3 changes: 3 additions & 0 deletions packages/commonjs/src/transform-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ export default async function transformCommonjs(
}
if (!ignoreDynamicRequires) {
if (isShorthandProperty(parent)) {
// as key and value are the same object, isReference regards
// both as references, so we need to skip now
skippedNodes.add(parent.value);
magicString.prependRight(node.start, 'require: ');
}
replacedDynamicRequires.push(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ module.exports = {
plugins: [
{
async buildStart() {
await this.resolve('./other.js', ID_MAIN, { isEntry: true, custom: { test: 42 } });
await this.resolve('./other.js', ID_MAIN, {
skipSelf: false,
isEntry: true,
custom: { test: 42 }
});
},
buildEnd() {
assert.deepStrictEqual(resolveIdArgs, [
['other.js', 'main.js', { assertions: {}, custom: { test: 42 }, isEntry: true }],
['main.js', void 0, { assertions: {}, custom: {}, isEntry: true }]
['other.js', 'main.js', { attributes: {}, custom: { test: 42 }, isEntry: true }],
['main.js', void 0, { attributes: {}, custom: {}, isEntry: true }]
]);
},
resolveId(source, importer, options) {
Expand Down
Loading

0 comments on commit 8f18688

Please sign in to comment.