Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xo linter, ava test framework, webpack build tool, README #147

Merged
merged 8 commits into from
Jul 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ build/temp/
build/zap-exts/
.idea/
*.iml
node_modules/
dist/
18 changes: 18 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,24 @@
<build-deploy-addon name="hud" />
</target>

<target name="lint-staged-hud" description="run the XO linter on the staged hud extension">
<exec executable="npm">
<arg line="run lint-staged" />
</exec>
</target>

<target name="lint-all-hud" description="run the XO linter on all files of the hud extension">
<exec executable="npm">
<arg line="run lint" />
</exec>
</target>

<target name="test-hud" description="run the ava tests for the hud extension">
<exec executable="npm">
<arg line="run test" />
</exec>
</target>

<target name="deploy-and-reset-hud" description="deploy the hud extension and delete the config directory">
<build-deploy-addon name="hud" />
<delete dir="${hud.config.dir}"/>
Expand Down
10 changes: 10 additions & 0 deletions build/loaders/zap-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = function zapLoader(source) {
source = source.replace("<<ZAP_HUD_FILES>>", "https://zap");
source = source.replace("<<ZAP_HUD_URL>>", "https://targetdomain.com");
source = source.replace("<<ZAP_HUD_API>>", "https://zap/api");
source = source.replace("<<ZAP_HUD_WS>>", "https://zap/websocket");
source = source.replace("<<ZAP_HUD_TOOLS>>", "'http://zap/to/some/tool'");
source = source.replace("<<ZAP_SHARED_SECRET>>", "sometestsecret");

return source;
};
34 changes: 34 additions & 0 deletions build/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict'

const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')

module.exports = {
mode: 'development',
entry: [
'./src/org/zaproxy/zap/extension/hud/files/hud/serviceworker.js',
'./src/org/zaproxy/zap/extension/hud/files/hud/panel.js'
],
resolveLoader: {
alias: {'zap-loader': path.join(__dirname, 'loaders/zap-loader.js')}
},
module: {
rules: [
{
test: /\.js$/,
use: [
'zap-loader'
]
},
{
test: /\.vue$/,
use: [
'vue-loader'
]
}
]
},
plugins: [
new VueLoaderPlugin()
]
}
Loading