From a957e841bf276b89723706ecbcee55d648acae2f Mon Sep 17 00:00:00 2001 From: Khiet Tam Nguyen Date: Thu, 23 Apr 2026 11:03:31 +1000 Subject: [PATCH 1/2] feat: bump esm-sync, supporting ES2022 arbitrary module namespace identifiers --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- tests/edge/edge.test.ts | 10 ++++++++++ tests/edge/literal-alias.js | 8 ++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 tests/edge/literal-alias.js diff --git a/package.json b/package.json index 8efa68b..285a52a 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "typescript": "^6.0.3" }, "dependencies": { - "esm-sync": "3.3.4" + "esm-sync": "3.3.5" }, "packageManager": "pnpm@10.33.0", "main": "./dist/index.cjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1660fa0..58dbaba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ importers: .: dependencies: esm-sync: - specifier: 3.3.4 - version: 3.3.4 + specifier: 3.3.5 + version: 3.3.5 devDependencies: '@commitlint/cli': specifier: ^20.5.0 @@ -1484,8 +1484,8 @@ packages: jiti: optional: true - esm-sync@3.3.4: - resolution: {integrity: sha512-sREHsPB/7OIQiI0u8rTYC+rYpxj5K9aIGN6NwOmuZR2QixINAXDEIuvwUwRdtI24FBpwnk/60aSujeDtp/f9Yg==} + esm-sync@3.3.5: + resolution: {integrity: sha512-ULAGe0/+AQWvaxLE41QLIZbld+6nyxf+p52dr7GUbSTcZjjMe/D6iafZ3GIx6PJiVXlJtVAKzIN7+SiskMYDGQ==} engines: {node: '>=6'} espree@10.4.0: @@ -4542,7 +4542,7 @@ snapshots: transitivePeerDependencies: - supports-color - esm-sync@3.3.4: + esm-sync@3.3.5: dependencies: punycode: 2.3.1 diff --git a/tests/edge/edge.test.ts b/tests/edge/edge.test.ts index 8a4a91a..b27124e 100644 --- a/tests/edge/edge.test.ts +++ b/tests/edge/edge.test.ts @@ -9,6 +9,16 @@ test('Broken file', () => { expect(() => importSync('./broken')).toThrow(Error); }); +test('Literal alias', () => { + expect(importSync('./literal-alias')).toMatchObject({ + myVar: 1531, + default: 1531, + 'module.exports': 1531, + myVarAlias: 1531, + ' __ :) __ ': 1531, + }); +}); + test.each([ { extension: '', message: 'JavaScript' }, { extension: '.js', message: 'JavaScript' }, diff --git a/tests/edge/literal-alias.js b/tests/edge/literal-alias.js new file mode 100644 index 0000000..219703b --- /dev/null +++ b/tests/edge/literal-alias.js @@ -0,0 +1,8 @@ +export const myVar = 1531; + +export { + myVar as default, + myVar as 'module.exports', + myVar as 'myVarAlias', + myVar as ' __ :) __ ', +}; From 89367ca5d78101ad432f427fc3ce26dcf3bed07a Mon Sep 17 00:00:00 2001 From: Khiet Tam Nguyen Date: Thu, 23 Apr 2026 11:12:45 +1000 Subject: [PATCH 2/2] test(literal-alias): separate default export, add emoji --- tests/edge/edge.test.ts | 1 + tests/edge/literal-alias.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/edge/edge.test.ts b/tests/edge/edge.test.ts index b27124e..6444a61 100644 --- a/tests/edge/edge.test.ts +++ b/tests/edge/edge.test.ts @@ -16,6 +16,7 @@ test('Literal alias', () => { 'module.exports': 1531, myVarAlias: 1531, ' __ :) __ ': 1531, + ' 😆 ': 1531, }); }); diff --git a/tests/edge/literal-alias.js b/tests/edge/literal-alias.js index 219703b..70897e8 100644 --- a/tests/edge/literal-alias.js +++ b/tests/edge/literal-alias.js @@ -1,8 +1,10 @@ export const myVar = 1531; export { - myVar as default, myVar as 'module.exports', myVar as 'myVarAlias', myVar as ' __ :) __ ', + myVar as ' 😆 ', }; + +export default myVar;