From 7b2ab822c65a22125afce12c1bd0aa593f83fd06 Mon Sep 17 00:00:00 2001 From: Steve Gravrock Date: Mon, 7 Apr 2025 20:26:18 -0700 Subject: [PATCH] Removed mostly-unmaintained dev dependency 'temp' temp has seen some recent maintainer activity but there haven't been any commits since 2021 and PRs have gone un-addressed for years. It's one of the dev dependencies that depends on very old versions of rimraf. --- package.json | 4 ++-- spec/npmPackage/npmPackageSpec.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a23e4c51..2188cf2e 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,9 @@ "jsdom": "^26.0.0", "load-grunt-tasks": "^5.1.0", "prettier": "1.17.1", + "rimraf": "^5.0.10", "sass": "^1.58.3", - "shelljs": "^0.9.2", - "temp": "^0.9.0" + "shelljs": "^0.9.2" }, "browserslist": [ "Safari >= 15", diff --git a/spec/npmPackage/npmPackageSpec.js b/spec/npmPackage/npmPackageSpec.js index 4cc67722..94f2f74a 100644 --- a/spec/npmPackage/npmPackageSpec.js +++ b/spec/npmPackage/npmPackageSpec.js @@ -1,14 +1,16 @@ -describe('npm package', function() { - const path = require('path'), - temp = require('temp').track(), - fs = require('fs'); +const fs = require('node:fs'); +const path = require('node:path'); +const os = require('node:os'); +const { rimrafSync } = require('rimraf'); +describe('npm package', function() { beforeAll(function() { const shell = require('shelljs'), pack = shell.exec('npm pack', { silent: true }); this.tarball = pack.stdout.split('\n')[0]; - this.tmpDir = temp.mkdirSync(); // automatically deleted on exit + const prefix = path.join(os.tmpdir(), 'jasmine-npm-package'); + this.tmpDir = fs.mkdtempSync(prefix); const untar = shell.exec( 'tar -xzf ' + this.tarball + ' -C ' + this.tmpDir, @@ -41,6 +43,7 @@ describe('npm package', function() { afterAll(function() { fs.unlinkSync(this.tarball); + rimrafSync(this.tmpDir); }); it('has a root path', function() {