Skip to content

Commit daf6714

Browse files
Merge pull request #454 from snyk-tech-services/chore/downgrade-node-back-to-12
chore: downgrade node to 12
2 parents 4742360 + 4248f48 commit daf6714

File tree

10 files changed

+26
-36
lines changed

10 files changed

+26
-36
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ orbs:
55
jobs:
66
build-test-monitor:
77
docker:
8-
- image: circleci/node:14
8+
- image: circleci/node:12
99
steps:
1010
- slack/notify:
1111
channel: C0137E8F72A
@@ -20,7 +20,7 @@ jobs:
2020
only_for_branches: master
2121
build-test:
2222
docker:
23-
- image: circleci/node:14
23+
- image: circleci/node:12
2424
steps:
2525
- checkout
2626
- run: npm install
@@ -33,7 +33,7 @@ jobs:
3333
only_for_branches: master
3434
build-test-from-fork:
3535
docker:
36-
- image: circleci/node:14
36+
- image: circleci/node:12
3737
steps:
3838
- checkout
3939
- run: npm install

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14
1+
12

.releaserc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
{
1010
"//": "build the macos",
1111
"path": "@semantic-release/exec",
12-
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t mac-x64-14.15.3 -o snyk-api-import-macos"
12+
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t mac-x64-12.9.0 -o snyk-api-import-macos"
1313
},
1414
{
1515
"//": "build the linux",
1616
"path": "@semantic-release/exec",
17-
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t linux-x64-14.15.3 -o snyk-api-import-linux"
17+
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t linux-x64-12.9.0 -o snyk-api-import-linux"
1818
},
1919
{
2020
"//": "build the alpine",
2121
"path": "@semantic-release/exec",
22-
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t alpine-x64-14.15.3 -o snyk-api-import-alpine"
22+
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t alpine-x64-12.9.0 -o snyk-api-import-alpine"
2323
},
2424
{
2525
"//": "build the windows binaries",
2626
"path": "@semantic-release/exec",
27-
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t windows-x64-14.15.3 -o snyk-api-import-win.exe"
27+
"cmd": "npx [email protected] dist/index.js -r './dist/**/*.js' -t windows-x64-12.9.0 -o snyk-api-import-win.exe"
2828
},
2929
{
3030
"//": "shasum all binaries",

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 12.22.12

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"build-watch": "tsc -w",
2020
"prepare": "npm run build",
2121
"snyk-test": "snyk test",
22-
"pkg-binaries-linux": "npx nexe@4.0.0-rc.2 dist/index.js -r './dist/**/*.js' -t linux-x64-14.15.3 -o snyk-api-import-linux",
23-
"pkg-binaries": "npx nexe@4.0.0-rc.2 dist/index.js -r './dist/**/*.js' -t mac-x64-14.15.3 -o snyk-api-import-macos"
22+
"pkg-binaries-linux": "npx nexe@3.3.7 dist/index.js -r './dist/**/*.js' -t linux-x64-12.9.0 -o snyk-api-import-linux",
23+
"pkg-binaries": "npx nexe@3.3.7 dist/index.js -r './dist/**/*.js' -t mac-x64-12.9.0 -o snyk-api-import-macos"
2424
},
2525
"types": "./dist/index.d.ts",
2626
"repository": {
@@ -30,7 +30,7 @@
3030
"author": "Snyk Tech Services",
3131
"license": "Apache-2.0",
3232
"engines": {
33-
"node": ">=14"
33+
"node": ">=12"
3434
},
3535
"files": [
3636
"bin",
@@ -47,7 +47,6 @@
4747
"bottleneck": "2.19.5",
4848
"bunyan": "1.8.15",
4949
"debug": "4.3.4",
50-
"fs-extra": "^11.1.1",
5150
"lodash": "4.17.21",
5251
"micromatch": "4.0.5",
5352
"needle": "2.9.1",
@@ -65,7 +64,6 @@
6564
"@semantic-release/exec": "5.0.0",
6665
"@types/bunyan": "1.8.6",
6766
"@types/debug": "4.1.5",
68-
"@types/fs-extra": "^11.0.1",
6967
"@types/jest": "^25.1.1",
7068
"@types/lodash": "^4.14.149",
7169
"@types/micromatch": "4.0.2",

src/lib/git-clone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function gitClone(
5353
} catch (err: any) {
5454
debug(`Could not shallow clone the repo:\n ${err}`);
5555
if (fs.existsSync(repoClonePath)) {
56-
fs.rmSync(repoClonePath, { recursive: true, maxRetries: 3, force: true });
56+
fs.rmdirSync(repoClonePath, { recursive: true, maxRetries: 3 });
5757
}
5858
return {
5959
success: false,

src/scripts/sync/clone-and-analyze.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function cloneAndAnalyze(
6363
);
6464

6565
try {
66-
fs.rmSync(repoPath, { recursive: true, maxRetries: 3, force: true });
66+
fs.rmdirSync(repoPath, { recursive: true, maxRetries: 3 });
6767
} catch (error) {
6868
debug(`Failed to delete ${repoPath}. Error was ${error}.`);
6969
}

test/lib/git-clone.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('gitClone', () => {
1313
afterEach(() => {
1414
for (const f of removeFolders) {
1515
try {
16-
fs.rmSync(f, { recursive: true, force: true, maxRetries: 3 });
16+
fs.rmdirSync(f, { recursive: true, maxRetries: 3 });
1717
} catch (e) {
1818
console.log('Failed to clean up test', e);
1919
}
@@ -76,7 +76,7 @@ describe('gitClone', () => {
7676
afterEach(() => {
7777
for (const f of removeFolders) {
7878
try {
79-
fs.rmSync(f, { recursive: true, maxRetries: 3, force: true });
79+
fs.rmdirSync(f, { recursive: true, maxRetries: 3 });
8080
} catch (e) {
8181
console.log('Failed to clean up test', e);
8282
}

test/scripts/sync/clone-and-analyze.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('cloneAndAnalyze', () => {
1515
afterEach(() => {
1616
for (const f of removeFolders) {
1717
try {
18-
fs.rmSync(f, { recursive: true, maxRetries: 3, force: true });
18+
fs.rmdirSync(f, { recursive: true, maxRetries: 3 });
1919
} catch (e) {
2020
console.log('Failed to clean up test', e);
2121
}

test/scripts/sync/sync-org-projects.test.ts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { requestsManager } from 'snyk-request-manager';
22
import * as uuid from 'uuid';
33
import * as path from 'path';
44
import * as fs from 'fs';
5-
import * as fse from 'fs-extra';
65
import {
76
updateOrgTargets,
87
updateTargets,
@@ -245,7 +244,7 @@ describe('updateTargets', () => {
245244
cloneSpy.mockImplementation(() =>
246245
Promise.resolve({
247246
success: true,
248-
repoPath: fixture('monorepo-new'),
247+
repoPath: path.resolve(fixturesFolderPath, 'monorepo-new'),
249248
gitResponse: '',
250249
}),
251250
);
@@ -354,7 +353,7 @@ describe('updateTargets', () => {
354353
cloneSpy.mockImplementation(() =>
355354
Promise.resolve({
356355
success: true,
357-
repoPath: fixture('goof'),
356+
repoPath: path.resolve(fixturesFolderPath, 'goof'),
358357
gitResponse: '',
359358
}),
360359
);
@@ -464,7 +463,7 @@ describe('updateTargets', () => {
464463
cloneSpy.mockImplementation(() =>
465464
Promise.resolve({
466465
success: true,
467-
repoPath: fixture('goof'),
466+
repoPath: path.resolve(fixturesFolderPath, 'goof'),
468467
gitResponse: '',
469468
}),
470469
);
@@ -555,7 +554,7 @@ describe('updateTargets', () => {
555554
cloneSpy.mockImplementation(() =>
556555
Promise.resolve({
557556
success: true,
558-
repoPath: fixture('goof'),
557+
repoPath: path.resolve(fixturesFolderPath, 'goof'),
559558
gitResponse: '',
560559
}),
561560
);
@@ -681,7 +680,7 @@ describe('updateTargets', () => {
681680
cloneSpy.mockImplementation(() =>
682681
Promise.resolve({
683682
success: true,
684-
repoPath: fixture('monorepo'),
683+
repoPath: path.resolve(fixturesFolderPath, 'monorepo'),
685684
gitResponse: '',
686685
}),
687686
);
@@ -891,7 +890,7 @@ describe('updateTargets', () => {
891890
cloneSpy.mockImplementation(() =>
892891
Promise.resolve({
893892
success: true,
894-
repoPath: fixture('monorepo'),
893+
repoPath: path.resolve(fixturesFolderPath, 'monorepo'),
895894
gitResponse: '',
896895
}),
897896
);
@@ -1034,7 +1033,7 @@ describe('updateTargets', () => {
10341033
cloneSpy.mockImplementation(() =>
10351034
Promise.resolve({
10361035
success: true,
1037-
repoPath: fixture('monorepo'),
1036+
repoPath: path.resolve(fixturesFolderPath, 'monorepo'),
10381037
gitResponse: '',
10391038
}),
10401039
);
@@ -1401,7 +1400,7 @@ describe('updateOrgTargets', () => {
14011400
cloneSpy.mockImplementation(() =>
14021401
Promise.resolve({
14031402
success: true,
1404-
repoPath: fixture('goof'),
1403+
repoPath: path.resolve(fixturesFolderPath, 'goof'),
14051404
gitResponse: '',
14061405
}),
14071406
);
@@ -1586,7 +1585,7 @@ describe('updateOrgTargets', () => {
15861585
cloneSpy.mockImplementation(() =>
15871586
Promise.resolve({
15881587
success: true,
1589-
repoPath: fixture('goof'),
1588+
repoPath: path.resolve(fixturesFolderPath, 'goof'),
15901589
gitResponse: '',
15911590
}),
15921591
);
@@ -1877,11 +1876,3 @@ describe('bulkImportTargetFiles', () => {
18771876
expect(updated.length).toEqual(5);
18781877
});
18791878
});
1880-
1881-
function fixture(name: string) {
1882-
const tempDir = fs.mkdtempSync('snyk-api-import-test-');
1883-
fse.copySync(path.resolve(fixturesFolderPath, name), tempDir, {
1884-
overwrite: true,
1885-
});
1886-
return tempDir;
1887-
}

0 commit comments

Comments
 (0)