Skip to content

Commit c4e47ee

Browse files
lukastaegertLarsDenBakker
authored andcommitted
feat(commonjs)!: return the namespace by default when requiring ESM (rollup#507)
* feat(commonjs): require ESM namespace by default, allow configuration BREAKING CHANGES: By default, require expressions will return the namespace of internal and external modules * chore(commonjs): refactor and clean up code * chore(commonjs): add documentation * feat(commonjs): add esmExternals option * fix(commonjs): handle requiring mixed ES modules * chore(commonjs): adapt to updated dependencies
1 parent 0b58d35 commit c4e47ee

File tree

129 files changed

+1748
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1748
-293
lines changed

codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ coverage:
55
round: down
66
range: 70...100
77
status:
8-
project: 'no'
9-
patch: 'yes'
10-
comment: 'off'
8+
project: "no"
9+
patch: "yes"
10+
comment: "off"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"ci:lint": "node scripts/run-changed.js ci:lint",
88
"ci:test": "node scripts/run-changed.js ci:test",
99
"lint": "pnpm run lint:docs && npm run lint:json && pnpm run lint:package && node scripts/run-changed.js lint",
10-
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
10+
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
1111
"lint:js": "eslint scripts util",
1212
"lint:json": "prettier --write tsconfig.*.json codecov.yml pnpm-workspace.yaml",
1313
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",

packages/alias/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
2323
"ci:test": "pnpm run test -- --verbose",
2424
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
25-
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
25+
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
2626
"lint:js": "eslint --fix --cache src test types --ext .js,.ts",
2727
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
2828
"prebuild": "del-cli dist",

packages/auto-install/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
2020
"ci:test": "pnpm run test -- --verbose",
2121
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
22-
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
22+
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
2323
"lint:js": "eslint --fix --cache src test --ext .js,.ts",
2424
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
2525
"prebuild": "del-cli dist",
@@ -54,9 +54,7 @@
5454
},
5555
"types": "types/index.d.ts",
5656
"ava": {
57-
"babel": {
58-
"compileEnhancements": false
59-
},
57+
"babel": true,
6058
"extensions": [
6159
"ts"
6260
],

packages/auto-install/test/npm-bare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('npm, bare', async (t) => {
18-
t.timeout(30000);
18+
t.timeout(50000);
1919
await rollup({
2020
input,
2121
output: {

packages/auto-install/test/npm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pkgFile = join(cwd, 'package.json');
1717
process.chdir(cwd);
1818

1919
test('invalid manager', (t) => {
20-
t.timeout(30000);
20+
t.timeout(50000);
2121
const error = t.throws(
2222
() =>
2323
rollup({
@@ -36,7 +36,7 @@ test('invalid manager', (t) => {
3636
});
3737

3838
test('npm', async (t) => {
39-
t.timeout(30000);
39+
t.timeout(50000);
4040
await rollup({
4141
input,
4242
output: {

packages/auto-install/test/yarn-bare.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('yarn, bare', async (t) => {
18-
t.timeout(30000);
18+
t.timeout(50000);
1919
await rollup({
2020
input,
2121
output: {

packages/auto-install/test/yarn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const input = join(cwd, '../input.js');
1515
process.chdir(cwd);
1616

1717
test('yarn', async (t) => {
18-
t.timeout(30000);
18+
t.timeout(50000);
1919
await rollup({
2020
input,
2121
output: {

packages/babel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
2323
"ci:test": "pnpm run test -- --verbose",
2424
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
25-
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
25+
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
2626
"lint:js": "eslint --fix --cache src test",
2727
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
2828
"prebuild": "del-cli dist",

packages/beep/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
2121
"ci:test": "ava --verbose",
2222
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
23-
"lint:docs": "prettier --single-quote --arrow-parens avoid --write README.md",
23+
"lint:docs": "prettier --single-quote --arrow-parens avoid --trailing-comma none --write README.md",
2424
"lint:js": "eslint --fix --cache lib test types --ext .js,.ts",
2525
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
2626
"test": "ava"

0 commit comments

Comments
 (0)