Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [20, 22, 24]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -29,6 +29,6 @@ jobs:
- name: Test
run: npm run build
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- run: pnpm i
Expand Down
15 changes: 5 additions & 10 deletions bin/linewrap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env node

import {inspect, promisify} from 'util';
import {inspect, promisify} from 'node:util';
import {LineWrap} from '@cto.af/linewrap';
import {fileURLToPath} from 'url';
import fs from 'fs';
import os from 'os';
import {fileURLToPath} from 'node:url';
import fs from 'node:fs';
import os from 'node:os';
import {parseArgsWithHelp} from 'minus-h';

export const DEFAULTS = {
Expand All @@ -30,11 +30,6 @@ const config = {
argumentName: 'string',
description: 'What string to use when a word is longer than the max width, and in overflow mode "clip"',
},
example7: {
short: '7',
type: 'boolean',
description: 'turn on the extra rules from Example 7 of UAX #14',
},
firstCol: {
short: 'c',
type: 'string',
Expand Down Expand Up @@ -210,7 +205,6 @@ export async function main(
const opts = {
escape: values.html ? htmlEscape : s => s,
ellipsis: values.ellipsis,
example7: Boolean(values.example7),
firstCol: parseInt(values.firstCol, 10),
hyphen: values.hyphen,
indent: parseInt(values.indent, 10) || values.indent,
Expand Down Expand Up @@ -256,6 +250,7 @@ export async function main(

if (fileURLToPath(import.meta.url) === process.argv[1]) {
main().catch(e => {
// eslint-disable-next-line no-console
console.error(e);
process.exit(1);
});
Expand Down
16 changes: 8 additions & 8 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import cjs from "@cto.af/eslint-config/cjs.js";
import mocha from "@cto.af/eslint-config/mocha.js"
import mod from "@cto.af/eslint-config/module.js";
import base from '@cto.af/eslint-config';
import cjs from '@cto.af/eslint-config/cjs.js';
import mod from '@cto.af/eslint-config/module.js';

export default [
{
ignores: [
"coverage/**",
"docs/**",
"node_modules/**",
"**/*.d.ts",
'coverage/**',
'docs/**',
'node_modules/**',
'**/*.d.ts',
],
},
...base,
...mod,
...cjs,
...mocha,
];
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"linewrap": "bin/linewrap.js"
},
"scripts": {
"test": "c8 mocha",
"test": "c8 node --test test/*.test.js",
"lint": "eslint .",
"build": "npm run lint && npm run test && npm pack --dry-run"
},
Expand All @@ -26,19 +26,18 @@
"license": "MIT",
"repository": "cto-af/linewrap-cli",
"dependencies": {
"@cto.af/linewrap": "2.1.3",
"minus-h": "2.1.0"
"@cto.af/linewrap": "3.0.0",
"minus-h": "3.0.0"
},
"devDependencies": {
"@cto.af/eslint-config": "4.1.6",
"@types/node": "22.5.4",
"c8": "10.1.2",
"eslint": "9.10.0",
"eslint-plugin-mocha": "10.5.0",
"mocha": "10.7.3"
"@cto.af/eslint-config": "6.0.4",
"@types/node": "22.15.29",
"c8": "10.1.3",
"eslint": "9.28.0",
"eslint-plugin-mocha": "11.1.0"
},
"packageManager": "pnpm@9.10.0",
"packageManager": "pnpm@10.11.0",
"engines": {
"node": ">= 18"
"node": ">=20"
}
}
Loading