Skip to content

Commit

Permalink
Break source code into modules
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Nov 5, 2024
1 parent c37a56b commit d67be24
Show file tree
Hide file tree
Showing 25 changed files with 2,378 additions and 354 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,4 @@ out
.clinic/

tags
tags.*

schedule.etag
schedule.json
security.etag
security.json
tags.*
2 changes: 1 addition & 1 deletion action.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require('@actions/core')
const { isNodeVulnerable } = require('./index')
const { isNodeVulnerable } = require('./src/index')

async function run () {
// Inputs
Expand Down
125 changes: 0 additions & 125 deletions eol-versions.js

This file was deleted.

213 changes: 0 additions & 213 deletions is-vulnerable.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "package that checks if your Node.js installation is vulnerable to known security vulnerabilities",
"main": "index.js",
"bin": {
"is-my-node-vulnerable": "./index.js"
"is-my-node-vulnerable": "./src/index.js"
},
"keywords": [
"security",
Expand Down
6 changes: 3 additions & 3 deletions setup-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const isOldEnough = require('./eol-versions')
const isNodeEOL = require('./src/is-node-eol')
const assert = require('assert')

// When old enough an error is thrown
if (isOldEnough(process.version)) {
if (isNodeEOL(process.version)) {
runCompatibilityTest()
} else {
require('./test')
Expand All @@ -11,7 +11,7 @@ if (isOldEnough(process.version)) {
function runCompatibilityTest () {
const childProcess = require('child_process')
const path = require('path')
const isNodeVulnerablePath = path.resolve('./index.js')
const isNodeVulnerablePath = path.resolve('./src/index.js')
const child = childProcess.spawnSync(process.execPath, [isNodeVulnerablePath])
assert.strictEqual(child.status, 1)
assert(child.stdout.toString().indexOf('is end-of-life. There are high chances of being vulnerable') !== -1)
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/cache/schedule.etag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"f333f2f1aaaec1ea47b3107fd989b1e1a736a46106a5910fc2f8672a01ba6754"
Loading

0 comments on commit d67be24

Please sign in to comment.