Skip to content

Commit

Permalink
deps: remove semver and mkdirp deps and add node17 test (#2641)
Browse files Browse the repository at this point in the history
* deps: remove semver and mkdirp deps

* ci: add node v17 test

* ci: change ci yml config

* ci: fix yml grammer error

* [skip ci] use matrix os
  • Loading branch information
iChenLei committed Nov 27, 2021
1 parent e64ae7d commit 3329f5b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -10,12 +10,10 @@ on:

jobs:
node_tests:
name: 'Test stylus on ${{matrix.os}} with node${{matrix.node}}'
name: 'Test stylus on ${{matrix.os}} with node16'
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Latest four Nodejs LTS version
node: [10, 12, 14, 16]
runs-on: ${{ matrix.os }}
steps:
# Pull repo to test machine
Expand All @@ -24,7 +22,7 @@ jobs:
- uses: actions/setup-node@v2
with:
# The Node.js version to configure
node-version: ${{ matrix.node }}
node-version: '16'
# Caching dependencies to speed up workflows
- name: Get npm cache directory
id: npm-cache-dir
Expand All @@ -43,8 +41,26 @@ jobs:
# Output useful info for debugging.
run: node --version && npm --version
- name: Run Test
run: npm run test

run: npm run test
# Not work currently, need investigate
#- name: Run Test Cov
# run: npm run test-cov

compat_node_tests:
name: 'Compat test stylus on ${{matrix.os}} with node${{matrix.node}}'
strategy:
matrix:
os: [ubuntu-latest]
node: [10, 12, 14, 17]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Run Test
run: npm run test
3 changes: 1 addition & 2 deletions bin/stylus
Expand Up @@ -12,8 +12,7 @@ var fs = require('fs')
, resolve = require('path').resolve
, join = require('path').join
, isWindows = process.platform === 'win32'
, semver = require('semver')
, mkdirSync = semver.satisfies(process.version, '>=10.12.0') ? fs.mkdirSync : require('mkdirp').sync;
, mkdirSync = fs.mkdirSync;

/**
* Arguments.
Expand Down
3 changes: 1 addition & 2 deletions lib/middleware.js
Expand Up @@ -9,14 +9,13 @@
*/

var stylus = require('./stylus')
, semver = require('semver')
, fs = require('fs')
, url = require('url')
, dirname = require('path').dirname
, join = require('path').join
, sep = require('path').sep
, debug = require('debug')('stylus:middleware')
, mkdir = semver.satisfies(process.version, '>=10.12.0') ? fs.mkdir : require('mkdirp');
, mkdir = fs.mkdir;

/**
* Import map.
Expand Down
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -32,10 +32,8 @@
"css": "^3.0.0",
"debug": "^4.3.2",
"glob": "^7.1.6",
"mkdirp": "~1.0.4",
"safer-buffer": "^2.1.2",
"sax": "~1.2.4",
"semver": "^6.3.0",
"source-map": "^0.7.3"
},
"devDependencies": {
Expand Down

0 comments on commit 3329f5b

Please sign in to comment.