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

# Conflicts:
#	packages/node-resolve/src/index.js
  • Loading branch information
bytestream committed Sep 25, 2023
2 parents 592cb4f + 902fb3d commit d3d583a
Show file tree
Hide file tree
Showing 84 changed files with 3,098 additions and 2,153 deletions.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ If yes, then include "BREAKING CHANGES:" in the first commit message body, follo

List any relevant issue numbers:

<!--
If this PR resolves any issues, list them as
resolves #1234
where 1234 is the issue number. This will help us with house-keeping as Github will automatically add a note to those issues stating that a potential fix exists. Once the PR is merged, Github will automatically close those issues.
If an issue is only solved partially or is relevant in some other way, just list the number without "resolves".
-->

### Description

<!--
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/node-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,31 @@ jobs:

strategy:
matrix:
node: ['18', '16', '14']
node: ['20', '18']

name: Node v${{ matrix.node }}
steps:
- name: Configure git line-breaks
run: git config --global core.autocrlf false

- name: Checkout Commit
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Checkout Master
run: git branch -f master origin/master
- name: Update Master
run: git pull --force --no-tags origin master:master

- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: install pnpm
run: npm install pnpm@7 -g
- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare pnpm@latest --activate
- name: pnpm install
run: pnpm install --ignore-scripts
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check PR Title
uses: clowdhaus/actions/pr-title@v0.1.0
with:
Expand Down
48 changes: 36 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,58 @@ jobs:

steps:
- name: Checkout Commit
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Update Master
run: |
git pull --force --no-tags origin master:master
git checkout master
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Checkout Master
- name: Enable Corepack
id: pnpm-setup
run: |
git branch -f master origin/master
git checkout master
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: ESLint Cache
uses: actions/cache@v3
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
restore-keys: |
${{ runner.os }}-eslintcache-
- name: Sanity Check
run: |
echo git `git version`;
echo branch `git branch --show-current`;
echo node `node -v`;
echo pnpm `pnpm -v`
echo `moon --version`
- name: Initliaze .npmrc
run: >
echo -e "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}\n$(cat .npmrc)" > .npmrc
&& cat -n .npmrc
- name: Install pnpm
run: |
npm install pnpm@7 -g;
echo node `pnpm -v`;
- name: Set Git Config
run: |
git config pull.rebase false
Expand All @@ -54,7 +78,7 @@ jobs:
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
- name: pnpm install
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build Packages
run: pnpm --recursive build
Expand Down
45 changes: 35 additions & 10 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,58 @@ jobs:

strategy:
matrix:
node: ['18', '16', '14']
node: ['20', '18']

name: Node v${{ matrix.node }}

steps:
- name: Checkout Commit
uses: actions/checkout@v1
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Update Master
run: git pull --force --no-tags origin master:master

- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Checkout Master
run: git branch -f master origin/master
- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm config set script-shell "/usr/bin/bash"
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: pnpm Cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-setup.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install pnpm
run: npm install pnpm@7 -g
- name: ESLint Cache
uses: actions/cache@v3
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslintcache-${{ hashFiles('./eslintcache') }}
restore-keys: |
${{ runner.os }}-eslintcache-
- name: Sanity Check
run: |
echo git `git version`;
echo branch `git branch --show-current`;
echo node `node --version`;
echo yarn `pnpm --version`
echo node `node -v`;
echo pnpm `pnpm -v`
echo `moon --version`
- name: pnpm install
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Prettier
run: pnpm run prettier:check
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
20
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"husky": "8.0.1",
"lint-staged": "11.0.1",
"nyc": "^15.1.0",
"pnpm": "^7.12.2",
"pnpm": "^8.7.5",
"prettier-plugin-package": "^1.3.0",
"semver": "^7.3.2",
"source-map-support": "^0.5.21",
Expand Down
1 change: 1 addition & 0 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"prebuild": "del-cli dist",
"prepare": "if [ ! -d 'dist' ]; then pnpm build; fi",
"prerelease": "pnpm build",
"pretest": "pnpm build",
"release": "pnpm --workspace-root plugin:release --pkg $npm_package_name",
Expand Down
16 changes: 16 additions & 0 deletions packages/commonjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @rollup/plugin-commonjs ChangeLog

## v25.0.4

_2023-08-11_

### Updates

- docs: update docs [#1545](https://github.com/rollup/plugins/pull/1545)

## v25.0.3

_2023-07-15_

### Bugfixes

- fix: preserve `this` reference in the child class [#1537](https://github.com/rollup/plugins/pull/1537)

## v25.0.2

_2023-06-19_
Expand Down
13 changes: 12 additions & 1 deletion packages/commonjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,18 @@ For these situations, you can change Rollup's behaviour either globally or per m
import * as dep$1 from 'dep';
function getAugmentedNamespace(n) {
var a = Object.defineProperty({}, '__esModule', { value: true });
if (n.__esModule) return n;
var f = n.default;
if (typeof f == 'function') {
var a = function a() {
if (this instanceof a) {
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else a = {};
Object.defineProperty(a, '__esModule', { value: true });
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "25.0.4",
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/commonjs/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export function getAugmentedNamespace(n) {
if (typeof f == "function") {
var a = function a () {
if (this instanceof a) {
var args = [null];
args.push.apply(args, arguments);
var Ctor = Function.bind.apply(f, args);
return new Ctor();
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function Dep(){};
export default Dep;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const Dep = require('./dep');

class Main extends Dep {
constructor() {
super();
this.name = this.constructor.name;
}
static name = "main";
}

t.is(new Main().name, "main");
Loading

0 comments on commit d3d583a

Please sign in to comment.