Skip to content

Commit 4bd0d93

Browse files
chore: upgrade deps. (#62)
1 parent fe5d345 commit 4bd0d93

6 files changed

Lines changed: 107 additions & 85 deletions

File tree

package-lock.json

Lines changed: 79 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@knighted/duel",
3-
"version": "2.1.2",
3+
"version": "2.1.3",
44
"description": "TypeScript dual packages.",
55
"type": "module",
66
"main": "dist/esm/duel.js",
@@ -63,14 +63,15 @@
6363
"eslint": "^9.16.0",
6464
"eslint-plugin-n": "^17.15.0",
6565
"globals": "^15.6.0",
66+
"node-module-type": "^1.0.2",
6667
"prettier": "^3.4.2",
6768
"tsx": "^4.19.3",
6869
"typescript": "^5.8.2",
69-
"vite": "^6.2.4"
70+
"vite": "^6.2.6"
7071
},
7172
"dependencies": {
72-
"@knighted/module": "^1.0.0-alpha.6",
73-
"@knighted/specifier": "^2.0.1",
73+
"@knighted/module": "^1.0.0-alpha.7",
74+
"@knighted/specifier": "^2.0.3",
7475
"find-up": "^6.3.0",
7576
"get-tsconfig": "^4.10.0",
7677
"glob": "^11.0.1",
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
import { other } from './other.js';
1+
import assert from 'node:assert'
2+
import { moduleType } from 'node-module-type'
3+
import { other } from './other.js'
4+
5+
const importOther = () => {
6+
import(`./${other}.js`).then(module => {
7+
/**
8+
* Conversion to CommonJS wraps the default export in a `default` property.
9+
* This is a workaround to make the test work in both ESM and CommonJS.
10+
* Another example of how default exports are an anti pattern.
11+
*/
12+
assert.deepStrictEqual(
13+
module.default,
14+
moduleType() === 'module' ? 'stuff' : { default: 'stuff' },
15+
)
16+
})
17+
}
18+
19+
importOther()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const other = 'other'
1+
export const other = 'stuff'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 'stuff'

test/integration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ describe('duel', () => {
273273
// Check for runtime errors against Node.js
274274
const { status: statusEsm } = spawnSync(
275275
'node',
276-
['test/__fixtures__/extended/dist/other.js'],
276+
['test/__fixtures__/extended/dist/file.js'],
277277
{ shell, stdio: 'inherit' },
278278
)
279279
assert.equal(statusEsm, 0)
280280
const { status: statusCjs } = spawnSync(
281281
'node',
282-
['test/__fixtures__/extended/dist/cjs/other.cjs'],
282+
['test/__fixtures__/extended/dist/cjs/file.cjs'],
283283
{ shell, stdio: 'inherit' },
284284
)
285285
assert.equal(statusCjs, 0)

0 commit comments

Comments
 (0)