Skip to content

Commit 0572596

Browse files
committed
Switch to ESM
Change-type: major
1 parent 7c682d3 commit 0572596

6 files changed

Lines changed: 18 additions & 16 deletions

File tree

lib/btrfs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { spawn } from './utils';
1+
import { spawn } from './utils.js';
22

33
export const deleteSubvolAsync = function (subvol: string) {
44
return spawn('btrfs', ['subvolume', 'delete', subvol]).waitAsync();

lib/docker-delta.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import path from 'node:path';
22
import Bluebird from 'bluebird';
33
import stream from 'node:stream';
44
import { TypedError } from 'typed-error';
5-
import * as rsync from './rsync';
6-
import * as btrfs from './btrfs';
7-
import { spawn } from './utils';
5+
import * as rsync from './rsync.js';
6+
import * as btrfs from './btrfs.js';
7+
import { spawn } from './utils.js';
88
import type Dockerode from 'dockerode';
99
import * as dt from 'docker-toolbelt';
1010

lib/rsync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'node:fs';
22
import tmp from 'tmp-promise';
33
import path from 'node:path';
4-
import { spawn, mkfifoSync } from './utils';
4+
import { spawn, mkfifoSync } from './utils.js';
55

66
export const createRsyncStream = async function (
77
src: string,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "docker-delta",
33
"version": "4.1.1",
44
"description": "Generate binary filesystem diffs between docker images to speed up distribution",
5-
"main": "out/docker-delta",
5+
"type": "module",
6+
"main": "out/docker-delta.js",
67
"engines": {
78
"node": ">=22.22.0 <23.0.0 || >=24.13.0"
89
},

test/docker-delta.spec.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
/* eslint-disable @typescript-eslint/no-require-imports */
2-
const { describe, before, it } = require('mocha');
3-
const chai = require('chai');
1+
import { describe, before, it } from 'mocha';
2+
import chai from 'chai';
43

5-
chai.use(require('chai-events'));
6-
chai.use(require('chai-stream'));
4+
import chaiEvents from 'chai-events';
5+
import chaiStream from 'chai-stream';
6+
chai.use(chaiEvents);
7+
chai.use(chaiStream);
78

8-
const JSONStream = require('JSONStream');
9-
const stream = require('node:stream');
10-
const Dockerode = require('dockerode');
9+
import JSONStream from 'JSONStream';
10+
import stream from 'node:stream';
11+
import Dockerode from 'dockerode';
1112

1213
const docker = new Dockerode();
1314

14-
const dockerDelta = require('..');
15+
import * as dockerDelta from '../out/docker-delta.js';
1516

1617
const { expect } = chai;
1718

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"module": "Node16",
3+
"module": "Node20",
44
"strict": true,
55
"noUnusedParameters": true,
66
"noUnusedLocals": true,

0 commit comments

Comments
 (0)