Skip to content

Commit 516961c

Browse files
committed
Update UMD fallback
1 parent 785a5d4 commit 516961c

File tree

7 files changed

+36
-45
lines changed

7 files changed

+36
-45
lines changed

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
}
3333
},
3434
"scripts": {
35-
"build": "esm2umd Long index.js > umd/index.js",
35+
"build": "esm2umd Long index.js > umd/index.js && prettier --write umd/index.js",
3636
"lint": "prettier --check .",
3737
"format": "prettier --write .",
3838
"test": "npm run test:unit && npm run test:typescript",
3939
"test:unit": "node tests",
40-
"test:typescript": "tsc --project tests/typescript/tsconfig.esnext.json && tsc --project tests/typescript/tsconfig.nodenext.json && tsc --project tests/typescript/tsconfig.commonjs.json"
40+
"test:typescript": "tsc --project tests/typescript/tsconfig.esnext.json && tsc --project tests/typescript/tsconfig.nodenext.json && tsc --project tests/typescript/tsconfig.commonjs.json && tsc --project tests/typescript/tsconfig.global.json"
4141
},
4242
"files": [
4343
"index.js",
@@ -50,7 +50,7 @@
5050
"README.md"
5151
],
5252
"devDependencies": {
53-
"esm2umd": "^0.2.2",
53+
"esm2umd": "^0.3.0",
5454
"prettier": "^3.5.0",
5555
"typescript": "^5.7.3"
5656
}

tests/typescript/test-global.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference path="../../umd/index.d.ts" />
2+
3+
Long.fromValue(1);
4+
var long = new Long(0, 0);
5+
long.toNumber();

tests/typescript/test-import.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Long from "../../index.js";
22

33
Long.fromValue(1);
4+
var long = new Long(0, 0);
5+
long.toNumber();
46

57
export default Long;

tests/typescript/test-require.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Long = require("../../umd/index.js");
22

33
Long.fromValue(1);
4+
var long = new Long(0, 0);
5+
long.toNumber();
46

57
export default Long;

tests/typescript/tsconfig.global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "None"
5+
},
6+
"include": ["./test-global.ts"]
7+
}

umd/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import { Long } from "../types.js";
22
export = Long;
3+
export as namespace Long;

0 commit comments

Comments
 (0)