Skip to content

Commit 97b4925

Browse files
committed
2.5.1
1 parent 679c798 commit 97b4925

File tree

8 files changed

+46
-60
lines changed

8 files changed

+46
-60
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [17.x, 16.x, 14.x, 12.x]
15+
node-version: [18.x, 17.x, 16.x, 14.x, 12.x]
1616

1717
steps:
1818
- uses: actions/checkout@v2

build/download-files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env tsx
22

3-
import fs from 'fs/promises';
3+
import fs from 'fs';
44
import path from 'path';
55

66
import loadFile from '../src/helpers/load-data';
@@ -9,7 +9,7 @@ async function writeFile(filename: string) {
99
const filePath = path.resolve('ext', filename);
1010
const fileData = await loadFile(filename, false);
1111
const fileContent = fileData.replace(/(\s+|^)#.*/g, '').replace(/\s+\n/g, '');
12-
fs.writeFile(filePath, fileContent)
12+
fs.promises.writeFile(filePath, fileContent)
1313
.then(() => console.log(`Successfully wrote ${filename}.`))
1414
.catch(() => console.log(`Failed to write ${filename}.`))
1515
}

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

3-
## Next
3+
## 2.5.1
4+
*2022-06-26*
45
- Fixed heuristics not being applied to files.
56
- Fixed heuristics with multiple rules not being parsed.
67

package-lock.json

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

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linguist-js",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"description": "Analyse languages used in a folder. Powered by GitHub Linguist, although it doesn't need to be installed.",
55
"main": "dist/index.js",
66
"bin": {
@@ -40,7 +40,7 @@
4040
"homepage": "https://github.com/Nixinova/Linguist#readme",
4141
"dependencies": {
4242
"binary-extensions": "^2.2.0",
43-
"commander": "^9.2.0",
43+
"commander": "^9.3.0",
4444
"common-path-prefix": "^3.0.0",
4545
"cross-fetch": "^3.1.5",
4646
"ignore": "^5.2.0",
@@ -49,10 +49,9 @@
4949
"node-cache": "^5.1.2"
5050
},
5151
"devDependencies": {
52-
"@types/glob-to-regexp": "ts4.6",
53-
"@types/js-yaml": "ts4.6",
54-
"@types/node": "ts4.6",
52+
"@types/js-yaml": "^4.0.5",
53+
"@types/node": "ts4.7",
5554
"deep-object-diff": "^1.1.7",
56-
"typescript": "~4.6.4"
55+
"typescript": "~4.7.4"
5756
}
5857
}

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ Running LinguistJS on this folder will return the following JSON:
7777
### Notes
7878

7979
- File paths in the output use only forward slashes as delimiters, even on Windows.
80-
- This tool does not work when offline.
8180
- Do not rely on any language classification output from LinguistJS being unchanged between runs.
8281
Language data is fetched each run from the latest classifications of [`github-linguist`](https://github.com/github/linguist).
8382
This data is subject to change at any time and may change the results of a run even when using the same version of Linguist.

src/helpers/load-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fs from 'fs/promises';
1+
import fs from 'fs';
22
import path from 'path';
33
import fetch from 'cross-fetch';
44
import Cache from 'node-cache';
@@ -18,7 +18,7 @@ async function loadWebFile(file: string): Promise<string> {
1818

1919
async function loadLocalFile(file: string): Promise<string> {
2020
const filePath = path.resolve(__dirname, '../../ext', file);
21-
return fs.readFile(filePath).then(buffer => buffer.toString());
21+
return fs.promises.readFile(filePath).then(buffer => buffer.toString());
2222
}
2323

2424
/** Load a data file from github-linguist. */

test/expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"count": 7,
44
"bytes": 46,
55
"results": {
6-
"~/al.al": "AL",
6+
"~/al.al": "Perl",
77
"~/file.txt": "JavaScript",
88
"~/folder/sub.txt": "Text",
99
"~/hashbang": "JavaScript",
@@ -16,7 +16,7 @@
1616
"count": 5,
1717
"bytes": 37,
1818
"results": {
19-
"AL": { "type": "programming", "bytes": 0, "color": "#3AA2B5" },
19+
"Perl": { "type": "programming", "bytes": 0, "color": "#0298c3" },
2020
"JavaScript": { "type": "programming", "bytes": 22, "color": "#f1e05a" },
2121
"Text": { "type": "prose", "bytes": 0 },
2222
"C++": { "type": "programming", "bytes": 15, "color": "#f34b7d" },

0 commit comments

Comments
 (0)