Skip to content

Commit 8641039

Browse files
committed
MAJOR: Switch to ESM / modernize
1 parent 0e50ccb commit 8641039

26 files changed

+1939
-5736
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
publish:
8+
name: Publish
9+
if: github.repository == 'dcodeIO/long.js'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
with:
14+
ref: main
15+
- uses: dcodeIO/setup-node-nvm@master
16+
with:
17+
node-version: current
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Run tests
21+
run: npm test
22+
- name: Publish
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26+
run: |
27+
VERSION=$(npx aspublish --version)
28+
if [ -z "$VERSION" ]; then
29+
echo "Changes do not trigger a release"
30+
else
31+
echo "Publishing new version: $VERSION"
32+
npx aspublish
33+
fi

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node_version: ["current", "lts_latest"]
14+
steps:
15+
- uses: actions/checkout@v1.0.0
16+
- uses: dcodeIO/setup-node-nvm@master
17+
with:
18+
node-version: ${{ matrix.node_version }}
19+
- name: Install dependencies
20+
run: npm ci --no-audit
21+
- name: Run tests
22+
run: npm test

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules/
22
npm-debug.*
3-
package-lock.json

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ long.js
44
A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library)
55
for stand-alone use and extended with unsigned support.
66

7-
[![npm](https://img.shields.io/npm/v/long.svg)](https://www.npmjs.com/package/long) [![Build Status](https://travis-ci.org/dcodeIO/long.js.svg)](https://travis-ci.org/dcodeIO/long.js)
7+
[![Build Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Test/main?label=test&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3ATest) [![Publish Status](https://img.shields.io/github/workflow/status/dcodeIO/long.js/Publish/main?label=publish&logo=github)](https://github.com/dcodeIO/long.js/actions?query=workflow%3APublish) [![npm](https://img.shields.io/npm/v/long.svg?label=npm&color=007acc&logo=npm)](https://www.npmjs.com/package/long)
88

99
Background
1010
----------
@@ -30,7 +30,7 @@ Usage
3030
The class is compatible with CommonJS and AMD loaders and is exposed globally as `Long` if neither is available.
3131

3232
```javascript
33-
var Long = require("long");
33+
import Long from "long";
3434

3535
var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF);
3636

@@ -238,18 +238,11 @@ API
238238
WebAssembly support
239239
-------------------
240240

241-
[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./src/wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node.
241+
[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node.
242242

243243
Building
244244
--------
245245

246-
To build an UMD bundle to `dist/long.js`, run:
247-
248-
```
249-
$> npm install
250-
$> npm run build
251-
```
252-
253246
Running the [tests](./tests):
254247

255248
```

bower.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

dist/long.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

dist/long.js.map

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy