Initial pipeline setup.

This commit is contained in:
Harrison Deng 2022-04-16 03:22:01 -05:00
parent 58ef009b88
commit edd2794eeb
9 changed files with 4657 additions and 3092 deletions

35
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,35 @@
pipeline{
agent any
stages{
stage("install") {
steps {
nodejs('NodeJS (17.4.0)') {
sh "npm install"
}
}
}
stage("build") {
steps {
nodejs('NodeJS (17.4.0)') {
sh "npm run build"
}
}
}
stage("test") {
steps {
nodejs('NodeJS (17.4.0)') {
sh "npm run test"
}
}
}
stage("publish docs") {
steps {
nodejs('NodeJS (17.4.0)') {
sh "npm run docs"
}
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'docs', reportFiles: 'index.html', reportName: 'AudioShowKit JSDocs', reportTitles: ''])
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'docs', reportFiles: 'index.html', reportName: 'AudioShowKit Demo', reportTitles: ''])
}
}
}
}

7633
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,20 +3,29 @@
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "app.js", "main": "app.js",
"private": true,
"type": "module",
"scripts": { "scripts": {
"start": "node app.js", "build": "webpack --config webpack.prod.js",
"test": "echo \"Error: no test specified\" && exit 1" "watch": "webpack serve --config webpack.dev.js",
"test": "echo \"No test specified yet...\" && exit 0",
"docs": "jsdoc src -r -d docs"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.9",
"@babel/preset-env": "^7.16.11",
"babel-loader": "^8.2.4",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"eslint": "^8.13.0", "eslint": "^8.13.0",
"eslint-plugin-jsdoc": "^39.2.1", "eslint-plugin-jsdoc": "^39.2.1",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"jsdoc": "^3.6.10",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"webpack": "^5.72.0", "webpack": "^5.72.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"
} }
} }

View File

@ -1,5 +1,4 @@
import "./styles/songplayer.css"; import "./styles/songplayer.css";
// TODO: Finish playlist, and basic music playback functionality.
// TODO: function to easily bind element styling to frequency bin. // TODO: function to easily bind element styling to frequency bin.
// TODO: adjust frequency bin interactively resulting in change in output. // TODO: adjust frequency bin interactively resulting in change in output.
// TODO: Set up global scope audioshowkit object. // TODO: Set up global scope audioshowkit object.

16
src/demo/index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AudioShowKit Demo</title>
<script src="../audioshowkit.js" defer></script>
</head>
<body>
</body>
</html>

0
src/demo/main.css Normal file
View File

View File

@ -1,21 +1,39 @@
import path from "path";
import HtmlWebpackPlugin from "html-webpack-plugin";
export default { export default {
entry: { entry: {
audioshowkit: "./src/audioshowkit.js" audioshowkit: path.resolve("./src/audioshowkit.js"),
}, },
module: { module: {
rules: [ rules: [
{ {
test: /\.html$/i, test: /\.m?js$/,
loader: "html-loader", exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
}, },
{ {
test: /\.css$/i, test: /\.css$/i,
use: ["style-loader", "css-loader"], use: ["style-loader", "css-loader"],
} },
{
test: /\.html$/i,
loader: "html-loader",
},
] ]
}, },
output: { output: {
filename: "[name].js", filename: "[name].js",
path: "./dist" path: path.resolve("./dist")
} },
plugins: [
new HtmlWebpackPlugin({
template: path.resolve("./src/demo/index.html"),
})
]
}; };

View File

@ -1,12 +1,14 @@
import merge from "webpack-merge"; import { merge } from "webpack-merge";
import webpackCommon from "./webpack.common"; import path from "path";
import webpackCommon from "./webpack.common.js";
const devConfig = { const devConfig = {
mode: "development", mode: "development",
devtools: "inline-source-map", devtools: "inline-source-map",
devServer: { devServer: {
static: "./dist" static: path.resolve("./dist"),
open: true
} }
}; };

View File

@ -1,12 +1,9 @@
import merge from "webpack-merge"; import { merge } from "webpack-merge";
import webpackCommon from "./webpack.common"; import webpackCommon from "./webpack.common.js";
const prodConfig = { const prodConfig = {
mode: "production", mode: "production",
output: {
filename: "[name].js",
path: "./public"
}
}; };
export default merge(webpackCommon, prodConfig); export default merge(webpackCommon, prodConfig);