Skip to content

Commit

Permalink
Update dependencies and drop Node.js < 18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 9, 2024
1 parent e98dfd2 commit 3b94d78
Show file tree
Hide file tree
Showing 8 changed files with 2,088 additions and 6,954 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: [14, 16, 18, 20]
node: [18, 20]

steps:
- name: Clone repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 18
NODE: 20

permissions:
contents: read
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

const program = require('commander');
const { program } = require('commander');
const lookup = require('../index.js');
const { name, description, version } = require('../package.json');

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ module.exports = function({ dependency, filename, directory } = {}) {

if (fs.existsSync(sameDir)) return sameDir;

debug('resolved file does not exist');
debug(`resolved file does not exist: ${sameDir}`);

// Check for dependency/index.styl file
const indexFile = path.join(path.resolve(fileDir, dependency), 'index.styl');
debug(`resolving dependency as if it points to an index.styl file: ${indexFile}`);

if (fs.existsSync(indexFile)) return indexFile;

debug('resolved file does not exist');
debug(`resolved file does not exist: ${indexFile}`);
debug('could not resolve the dependency');

return '';
Expand Down
9,011 changes: 2,073 additions & 6,938 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
},
"homepage": "https://github.com/dependents/node-stylus-lookup",
"engines": {
"node": ">=14"
"node": ">=18"
},
"dependencies": {
"commander": "^10.0.1"
"commander": "^12.0.0"
},
"devDependencies": {
"c8": "^7.13.0",
"c8": "^9.1.0",
"mock-fs": "^5.2.0",
"uvu": "^0.5.6",
"xo": "^0.54.2"
"xo": "^0.58.0"
},
"xo": {
"space": true,
Expand Down
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ testSuite('throws if directory is not supplied', () => {
});

testSuite('handles index.styl lookup', () => {
const expected = path.normalize(`${process.cwd()}/example/blueprint/index.styl`);
const expected = path.join(process.cwd(), '/example/blueprint/index.styl');
const actual = lookup({
dependency: 'blueprint',
filename: 'example/styles.styl',
Expand All @@ -61,7 +61,7 @@ testSuite('handles index.styl lookup', () => {
});

testSuite('handles .css lookups', () => {
const expected = path.normalize(`${process.cwd()}/example/styles2.css`);
const expected = path.join(process.cwd(), '/example/styles2.css');
const actual = lookup({
dependency: 'styles2.css',
filename: 'example/styles.styl',
Expand All @@ -72,7 +72,7 @@ testSuite('handles .css lookups', () => {
});

testSuite('handles same directory lookup', () => {
const expected = path.normalize(`${process.cwd()}/example/another.styl`);
const expected = path.join(process.cwd(), '/example/another.styl');
const actual = lookup({
dependency: 'another',
filename: 'example/main.styl',
Expand All @@ -83,7 +83,7 @@ testSuite('handles same directory lookup', () => {
});

testSuite('handles subdirectory lookup', () => {
const expected = path.normalize(`${process.cwd()}/example/nested/foo.styl`);
const expected = path.join(process.cwd(), '/example/nested/foo.styl');
const actual = lookup({
dependency: 'nested/foo',
filename: 'example/another.styl',
Expand All @@ -94,7 +94,7 @@ testSuite('handles subdirectory lookup', () => {
});

testSuite('handles extensionless lookup', () => {
const expected = path.normalize(`${process.cwd()}/example/another.styl`);
const expected = path.join(process.cwd(), '/example/another.styl');
const actual = lookup({
dependency: 'another',
filename: 'example/main.styl',
Expand All @@ -105,7 +105,7 @@ testSuite('handles extensionless lookup', () => {
});

testSuite('handles extensioned lookup', () => {
const expected = path.normalize(`${process.cwd()}/example/styles.styl`);
const expected = path.join(process.cwd(), '/example/styles.styl');
const actual = lookup({
dependency: 'styles.styl',
filename: 'example/main.styl',
Expand Down

0 comments on commit 3b94d78

Please sign in to comment.