Skip to content

Commit

Permalink
Merge pull request #496 from AikidoSec/replace-makefile
Browse files Browse the repository at this point in the history
Use npm run instead of Makefile
  • Loading branch information
hansott authored Jan 15, 2025
2 parents f874153 + d193d7a commit 588f93b
Show file tree
Hide file tree
Showing 37 changed files with 1,928 additions and 1,002 deletions.
15 changes: 8 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ First off, thanks for taking the time to contribute! ❤️
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉

> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
>
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
Expand Down Expand Up @@ -64,7 +65,7 @@ We use GitHub issues to track bugs and errors. If you run into an issue with the

- Open an [Issue](https://github.com/AikidoSec/firewall-node/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
- Please provide as much context as possible and describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
- Provide the information you collected in the previous section.

Once it's filed:
Expand Down Expand Up @@ -96,12 +97,12 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/Aikido
### Your First Code Contribution

- clone the repository to your local machine
- run `$ make install` to install dependencies
- run `$ make build` to build the library
- run `$ make watch` to watch for changes and rebuild the library
- run `$ make test` to run tests using tap
- run `$ make end2end` to run end-to-end tests using tap
- run `$ make lint` to run ESLint
- run `$ npm install` to install dependencies
- run `$ npm run build` to build the library
- run `$ npm run watch` to watch for changes and rebuild the library
- run `$ npm t` to run tests using tap
- run `$ npm run end2end` to run end-to-end tests using tap
- run `$ npm run lint` to run ESLint

## Styleguides

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y wrk
- run: make install
- run: make build
- run: npm install
- run: npm run build
- name: Run NoSQL Injection Benchmark
run: cd benchmarks/nosql-injection && AIKIDO_CI=true node benchmark.js
- name: Run SQL Injection Benchmark
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
registry-url: "https://registry.npmjs.org"
scope: "@aikidosec"
- name: Install dependencies
run: make install
run: npm install
- name: Get the version
id: get_version
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Set the version
run: cd library && npm --no-git-tag-version version ${{ steps.get_version.outputs.tag }}
- name: Build the library
run: make build
run: npm run build
- name: Linting
run: make lint
run: npm run lint
- name: Publish to NPM
run: |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ jobs:
- name: Build and run server
run: |
cd end2end/server && docker build -t server . && docker run -d -p 5874:3000 server
- run: make install
- run: make build
- run: make end2end
- run: npm install
- run: npm run build
- run: npm run end2end
6 changes: 3 additions & 3 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- run: make install-lib-only
- run: make build
- run: make lint
- run: npm run install-lib-only
- run: npm run build
- run: npm run lint
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ jobs:
- name: Add local.aikido.io to /etc/hosts
run: |
sudo echo "127.0.0.1 local.aikido.io" | sudo tee -a /etc/hosts
- run: make install-lib-only
- run: make build
- run: make test-ci
- run: npm run install-lib-only
- run: npm run build
- run: npm run test:ci
- name: "Upload coverage"
uses: codecov/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11
22.12
153 changes: 0 additions & 153 deletions Makefile

This file was deleted.

2 changes: 0 additions & 2 deletions benchmarks/sql-injection/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**
* Runs benchmarks for the detection of SQL Injections
*/
const fs = require("fs");
const { join } = require("path");
const {
detectSQLInjection,
} = require("../../build/vulnerabilities/sql-injection/detectSQLInjection");
Expand Down
Loading

0 comments on commit 588f93b

Please sign in to comment.