Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add exportsInfo to Module class * test: regression test * feat: reimplement * feat: optimize * test: add test * test: tweak * fix: avoid overwriting * test: change test * test: tweak * feat: tweak * docs: add description about 'exports' and 'exportedBindings' Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
- Loading branch information
1 parent
9900792
commit de6675b
Showing
17 changed files
with
152 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const assert = require('node:assert'); | ||
const path = require('node:path'); | ||
|
||
const ID_MAIN = path.join(__dirname, 'main.js'); | ||
const ID_MODULE = path.join(__dirname, 'module.js'); | ||
const ID_MODULE_2 = path.join(__dirname, 'module2.js'); | ||
|
||
const expectedResult = { | ||
[ID_MAIN]: { | ||
exports: ['moduleAlias', '*'], | ||
exportedBindings: { '.': [], './module.js': ['moduleAlias', '*'] } | ||
}, | ||
[ID_MODULE]: { | ||
exports: ['default', 'module', '*'], | ||
exportedBindings: { '.': ['default', 'module'], './module2.js': ['*'] } | ||
}, | ||
[ID_MODULE_2]: { | ||
exports: ['module2'], | ||
exportedBindings: { '.': ['module2'] } | ||
} | ||
}; | ||
|
||
module.exports = { | ||
description: 'check exports and exportedBindings in moduleParsed as a supplementary test', | ||
options: { | ||
plugins: { | ||
moduleParsed(moduleInfo) { | ||
const { exports, exportedBindings, id } = moduleInfo; | ||
assert.deepStrictEqual({ exports, exportedBindings }, expectedResult[id]); | ||
} | ||
} | ||
} | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './module.js'; | ||
export { module as moduleAlias } from './module.js'; | ||
assert.ok(true); |
3 changes: 3 additions & 0 deletions
3
test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './module2.js'; | ||
export default 1; | ||
export const module = 1; |
1 change: 1 addition & 0 deletions
1
test/function/samples/check-exports-exportedBindings-as-a-supplementary-test/module2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const module2 = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters