Skip to content

Commit

Permalink
Fix: rimraf version + remove conflicting types (#1475)
Browse files Browse the repository at this point in the history
* Fix: `rimraf` version + remove conflicting types

* chore: refactor `rimraf` import

* chore: clean up
  • Loading branch information
danielbankhead authored Jul 18, 2023
1 parent f4a46be commit f9f8b13
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@types/object-hash": "^3.0.0",
"@types/proxyquire": "^1.3.28",
"@types/pumpify": "^1.4.1",
"@types/rimraf": "^3.0.2",
"@types/sinon": "^10.0.0",
"@types/uglify-js": "^3.17.0",
"c8": "^8.0.0",
Expand All @@ -50,7 +49,7 @@
"protobufjs-cli": "1.1.1",
"proxyquire": "^2.0.1",
"pumpify": "^2.0.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.1",
"sinon": "^15.0.0",
"stream-events": "^1.0.4",
"ts-loader": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/showcase-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"download": "^8.0.0",
"execa": "^5.0.0",
"rimraf": "^3.0.0"
"rimraf": "^5.0.1"
},
"devDependencies": {
"@types/download": "^8.0.1",
Expand Down
6 changes: 3 additions & 3 deletions test/showcase-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import * as execa from 'execa';
import * as download from 'download';
import * as fs from 'fs';
import * as path from 'path';
import * as rimraf from 'rimraf';
import {rimraf} from 'rimraf';
import * as util from 'util';

const mkdir = util.promisify(fs.mkdir);
const rmrf = util.promisify(rimraf);

const timeout = 5000; // wait after the server launches

function sleep(timeoutMs: number) {
Expand All @@ -41,7 +41,7 @@ export class ShowcaseServer {
const fallbackServerUrl = `https://github.com/googleapis/gapic-showcase/releases/download/v${showcaseVersion}/${tarballFilename}`;
const binaryName = './gapic-showcase';

await rmrf(testDir);
await rimraf(testDir);
await mkdir(testDir);
process.chdir(testDir);
console.log(`Server will be run from ${testDir}.`);
Expand Down
5 changes: 2 additions & 3 deletions test/system-test/test.clientlibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
import * as execa from 'execa';
import * as fs from 'fs';
import * as path from 'path';
import * as rimraf from 'rimraf';
import {rimraf} from 'rimraf';
import * as util from 'util';
import {describe, it, before} from 'mocha';

const rmrf = util.promisify(rimraf);
const mkdir = util.promisify(fs.mkdir);
const readFile = util.promisify(fs.readFile);
const writeFile = util.promisify(fs.writeFile);
Expand Down Expand Up @@ -198,7 +197,7 @@ describe('Run system tests for some libraries', () => {
throw new Error(`npm pack tarball ${toolsTarball} does not exist`);
}

await rmrf(testDir);
await rimraf(testDir);
await mkdir(testDir);
process.chdir(testDir);
console.log(`Running tests in ${testDir}.`);
Expand Down
5 changes: 2 additions & 3 deletions tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
"author": "Google API Authors",
"license": "Apache-2.0",
"dependencies": {
"@types/rimraf": "^3.0.2",
"google-proto-files": "^3.0.0",
"protobufjs-cli": "1.1.1",
"rimraf": "^5.0.1",
"uglify-js": "^3.17.0",
"walkdir": "^0.4.0",
"rimraf": "^3.0.2"
"walkdir": "^0.4.0"
},
"repository": "googleapis/gax-nodejs",
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions tools/test/compileProtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
import * as assert from 'assert';
import {describe, it, beforeEach, afterEach} from 'mocha';
import * as fs from 'fs';
import * as rimraf from 'rimraf';
import {rimraf} from 'rimraf';
import * as util from 'util';
import * as path from 'path';
import * as protobuf from 'protobufjs';
import * as compileProtos from '../src/compileProtos';

const readFile = util.promisify(fs.readFile);
const mkdir = util.promisify(fs.mkdir);
const rmrf = util.promisify(rimraf);

const testDir = path.join(process.cwd(), '.compileProtos-test');
const resultDir = path.join(testDir, 'protos');
Expand All @@ -38,7 +37,7 @@ const expectedTSResultFile = path.join(resultDir, 'protos.d.ts');
describe('compileProtos tool', () => {
beforeEach(async () => {
if (fs.existsSync(testDir)) {
await rmrf(testDir);
await rimraf(testDir);
}
await mkdir(testDir);
await mkdir(resultDir);
Expand Down
5 changes: 2 additions & 3 deletions tools/test/minify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ import * as assert from 'assert';
import {describe, it, beforeEach} from 'mocha';
import * as fs from 'fs';
import {promises as fsp} from 'fs';
import * as rimraf from 'rimraf';
import {rimraf} from 'rimraf';
import * as path from 'path';
import * as minify from '../src/minify';
import {promisify} from 'util';

Check warning on line 22 in tools/test/minify.ts

View workflow job for this annotation

GitHub Actions / lint-tools

'promisify' is defined but never used

const rmrf = promisify(rimraf);
const testDir = path.join(process.cwd(), '.minify-test');
const fixturesDir = path.join(__dirname, '..', 'test', 'fixtures');

describe('minify tool', () => {
beforeEach(async () => {
if (fs.existsSync(testDir)) {
await rmrf(testDir);
await rimraf(testDir);
}
await fsp.mkdir(testDir);
});
Expand Down

0 comments on commit f9f8b13

Please sign in to comment.