Skip to content

Commit dd6dd7f

Browse files
author
Lukas Holzer
committed
chore: remove type module
1 parent 9caa008 commit dd6dd7f

10 files changed

+18
-19
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = {
2525
overrides: [
2626
...overrides,
2727
{
28-
files: ['src/**/*.test.ts', 'vitest.config.ts'],
28+
files: ['src/**/*.test.{ts,mts}', 'vitest.config.ts'],
2929
rules: {
3030
'max-lines-per-function': 'off',
3131
'max-nested-callbacks': 'off',

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@
22
"name": "@netlify/blobs",
33
"version": "1.6.0",
44
"description": "A JavaScript client for the Netlify Blob Store",
5-
"type": "module",
6-
"main": "./dist/main.cjs",
7-
"module": "./dist/main.js",
5+
"main": "./dist/main.js",
6+
"module": "./dist/main.mjs",
87
"types": "./dist/main.d.ts",
98
"exports": {
109
".": {
1110
"require": {
12-
"types": "./dist/main.d.cts",
13-
"path": "./dist/main.cjs"
14-
},
15-
"import": {
1611
"types": "./dist/main.d.ts",
1712
"path": "./dist/main.js"
1813
},
14+
"import": {
15+
"types": "./dist/main.d.mts",
16+
"path": "./dist/main.mjs"
17+
},
1918
"default": {
20-
"types": "./dist/main.d.ts",
21-
"path": "./dist/main.js"
19+
"types": "./dist/main.d.mts",
20+
"path": "./dist/main.mjs"
2221
}
2322
}
2423
},
@@ -27,7 +26,7 @@
2726
],
2827
"scripts": {
2928
"prebuild": "rm -rf dist",
30-
"build": "tsup src/main.ts --d ./dist --format esm,cjs --dts --target es2021",
29+
"build": "tsup src/main.mts --d ./dist --format esm,cjs --dts --target es2021",
3130
"dev": "npm run build -- --watch",
3231
"prepare": "husky install node_modules/@netlify/eslint-config-node/.husky/",
3332
"prepublishOnly": "npm ci && npm test",
@@ -48,8 +47,8 @@
4847
"test:ci:vitest": "vitest run"
4948
},
5049
"config": {
51-
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\"",
52-
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\""
50+
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github}/**/*.{js,mts,cts,ts,md,html}\" \"*.{js,mts,cts,ts,md,html}\"",
51+
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,scripts,.github}/**/*.{js,mts,cts,ts,md,yml,json,html}\" \"*.{js,mts,cts,ts,yml,json,html}\" \".*.{js,mts,cts,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\""
5352
},
5453
"keywords": [],
5554
"license": "MIT",

src/index.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './main.mjs'

src/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main.ts renamed to src/main.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Readable } from 'node:stream'
44

55
import pMap from 'p-map'
66

7-
import { fetchAndRetry } from './retry.js'
7+
import { fetchAndRetry } from './retry.mjs'
88

99
interface APICredentials {
1010
apiURL?: string

src/main.test.ts renamed to src/main.test.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import semver from 'semver'
55
import tmp from 'tmp-promise'
66
import { describe, test, expect, beforeAll } from 'vitest'
77

8-
import { MockFetch } from '../test/mock_fetch.js'
9-
import { streamToString } from '../test/util.js'
8+
import { MockFetch } from '../test/mock_fetch.mjs'
9+
import { streamToString } from '../test/util.mjs'
1010

11-
import { Blobs } from './main.js'
11+
import { Blobs } from './main.mjs'
1212

1313
beforeAll(async () => {
1414
if (semver.lt(nodeVersion, '18.0.0')) {
File renamed without changes.
File renamed without changes.
File renamed without changes.

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
target: 'esnext',
66
},
77
test: {
8-
include: ['src/**/*.test.ts'],
8+
include: ['src/**/*.test.mts'],
99
testTimeout: 30_000,
1010
},
1111
})

0 commit comments

Comments
 (0)