Skip to content

Commit 1cf57de

Browse files
committed
chore: modernize tooling and convert to ESM
- Convert package to ESM (type=module, exports map) - Bump Node engine to >=22.13 - Replace tape/ts-node/tslint/package-preview with node:test + tsx - Switch tsconfig to NodeNext, target es2022 - Replace Travis CI with GitHub Actions (Node 22, 24 on Ubuntu/macOS/Windows) - Replace deprecated substr() with slice() - Replace default export of parseNpmTarballUrl with a named export - Drop unused typings/ directory (stub for semver-regex which is not used)
1 parent cf33cfc commit 1cf57de

12 files changed

Lines changed: 770 additions & 1807 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
node: [22, 24]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@91ab88e2619ed1f46221f0ba42d1492c02baf788
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node }}
23+
cache: pnpm
24+
- run: pnpm install --frozen-lockfile
25+
- run: pnpm test

.travis.yml

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

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# parse-npm-tarball-url
22

3-
[![Build Status](https://travis-ci.org/pnpm/parse-npm-tarball-url.svg?branch=master)](https://travis-ci.org/pnpm/parse-npm-tarball-url)
4-
53
> Parse a tarball URL hosted in the npm registry
64
75
## Installation
@@ -13,9 +11,9 @@
1311
## Usage
1412

1513
```js
16-
import parseNpmTarbalUrl from 'parse-npm-tarball-url'
14+
import { parseNpmTarballUrl } from 'parse-npm-tarball-url'
1715

18-
const pkg = parseNpmTarbalUrl('http://registry.npmjs.org/foo/-/foo-1.0.0.tgz')
16+
const pkg = parseNpmTarballUrl('http://registry.npmjs.org/foo/-/foo-1.0.0.tgz')
1917

2018
console.log(pkg)
2119
// {

package.json

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
{
22
"name": "parse-npm-tarball-url",
3-
"version": "4.0.0",
3+
"version": "5.0.0",
44
"description": "Parse a tarball URL hosted in the npm registry",
5+
"type": "module",
56
"main": "lib/index.js",
6-
"typings": "lib/index.d.ts",
7+
"types": "lib/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./lib/index.d.ts",
11+
"default": "./lib/index.js"
12+
}
13+
},
714
"engines": {
8-
"node": ">=18.12"
15+
"node": ">=22.13"
916
},
1017
"files": [
11-
"lib"
18+
"lib/",
19+
"!*.map"
1220
],
1321
"scripts": {
14-
"test": "npm run lint && preview && ts-node test --type-check",
15-
"lint": "tslint -c tslint.json --project .",
16-
"tsc": "rimraf lib && tsc",
17-
"prepublishOnly": "npm run tsc"
22+
"build": "rimraf lib && tsc",
23+
"test": "tsx --test test/*.test.ts",
24+
"prepublishOnly": "pnpm run build"
1825
},
1926
"repository": {
2027
"type": "git",
@@ -37,18 +44,21 @@
3744
"url": "https://github.com/pnpm/parse-npm-tarball-url/issues"
3845
},
3946
"homepage": "https://github.com/pnpm/parse-npm-tarball-url#readme",
47+
"dependencies": {
48+
"semver": "^7.6.3"
49+
},
4050
"devDependencies": {
41-
"@types/node": "^12.0.2",
42-
"@types/semver": "^7.0.0",
43-
"@types/tape": "^4.2.29",
44-
"package-preview": "^3.0.0",
45-
"rimraf": "^3.0.0",
46-
"tape": "^5.0.0",
47-
"ts-node": "^9.0.0",
48-
"tslint": "^6.0.0",
49-
"typescript": "^4.0.0"
51+
"@types/node": "^22.10.5",
52+
"@types/semver": "^7.5.8",
53+
"rimraf": "^6.0.1",
54+
"tsx": "^4.19.2",
55+
"typescript": "^5.7.3"
5056
},
51-
"dependencies": {
52-
"semver": "^7.0.0"
57+
"devEngines": {
58+
"packageManager": {
59+
"name": "pnpm",
60+
"version": "11",
61+
"onFail": "download"
62+
}
5363
}
5464
}

0 commit comments

Comments
 (0)