From b36d06ec4b41fbeeea91f7ceac07baac1765818d Mon Sep 17 00:00:00 2001 From: iChenLei Date: Sat, 27 Nov 2021 14:32:26 +0800 Subject: [PATCH 1/5] deps: remove semver and mkdirp deps --- bin/stylus | 3 +-- lib/middleware.js | 3 +-- package-lock.json | 10 ---------- package.json | 2 -- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/bin/stylus b/bin/stylus index 80bd61845..df9a18b63 100755 --- a/bin/stylus +++ b/bin/stylus @@ -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. diff --git a/lib/middleware.js b/lib/middleware.js index d49e7767c..84884cca4 100644 --- a/lib/middleware.js +++ b/lib/middleware.js @@ -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. diff --git a/package-lock.json b/package-lock.json index be16da60f..31fe25116 100644 --- a/package-lock.json +++ b/package-lock.json @@ -545,11 +545,6 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, "mocha": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", @@ -785,11 +780,6 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", diff --git a/package.json b/package.json index 4919bed7b..154c1955d 100644 --- a/package.json +++ b/package.json @@ -32,10 +32,8 @@ "css": "^3.0.0", "debug": "~3.1.0", "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": { From 03469c0ff9566036e6582a418951f8430f6a74c1 Mon Sep 17 00:00:00 2001 From: iChenLei Date: Sat, 27 Nov 2021 14:34:12 +0800 Subject: [PATCH 2/5] ci: add node v17 test --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b41c07bc2..728321a34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - # Latest four Nodejs LTS version - node: [10, 12, 14, 16] + node: [12, 14, 16, 17] runs-on: ${{ matrix.os }} steps: # Pull repo to test machine From bab3fcd62f418a8218bd2c4f8d42f40fc50fcea4 Mon Sep 17 00:00:00 2001 From: iChenLei Date: Sat, 27 Nov 2021 15:06:47 +0800 Subject: [PATCH 3/5] ci: change ci yml config --- .github/workflows/ci.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 728321a34..6fd6ccd50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +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] - node: [12, 14, 16, 17] runs-on: ${{ matrix.os }} steps: # Pull repo to test machine @@ -23,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 @@ -42,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 ubuntu 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 From 118197cf519ba8d47cf47c2d08f97601ddfbf63d Mon Sep 17 00:00:00 2001 From: iChenLei Date: Sat, 27 Nov 2021 15:09:14 +0800 Subject: [PATCH 4/5] ci: fix yml grammer error --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fd6ccd50..64eb7f13a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: name: 'Compat test stylus on ubuntu with node${{matrix.node}}' strategy: matrix: - os: [ubuntu-latest], + os: [ubuntu-latest] node: [10, 12, 14, 17] runs-on: ${{ matrix.os }} steps: From af6d2f997de91df46b12f32b3e8f614480e2f174 Mon Sep 17 00:00:00 2001 From: iChenLei Date: Sat, 27 Nov 2021 15:11:33 +0800 Subject: [PATCH 5/5] [skip ci] use matrix os --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64eb7f13a..c6477b5e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: # run: npm run test-cov compat_node_tests: - name: 'Compat test stylus on ubuntu with node${{matrix.node}}' + name: 'Compat test stylus on ${{matrix.os}} with node${{matrix.node}}' strategy: matrix: os: [ubuntu-latest]