Added babel to showcase project.

This commit is contained in:
Harrison Deng 2022-04-17 22:35:25 -05:00
parent 2c8f3a49c4
commit b5a4a7dcb4
7 changed files with 6241 additions and 26 deletions

56
Jenkinsfile vendored
View File

@ -29,44 +29,48 @@ pipeline {
} }
} }
} }
stage("generate docs") { stage("archive product") {
steps { steps {
dir('audioshowkit') {
nodejs('NodeJS (17.4.0)') {
sh "npm run docs"
}
}
}
}
stage("publish") {
steps {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'audioshowkit/docs', reportFiles: 'index.html', reportName: 'AudioShowKit JSDocs', reportTitles: ''])
archiveArtifacts artifacts: 'audioshowkit/dist/audioshowkit.js', followSymlinks: false archiveArtifacts artifacts: 'audioshowkit/dist/audioshowkit.js', followSymlinks: false
} }
} }
stage("setup showcase") { stage("publish") {
stages { parallel {
stage("install showcase") { stage("setup showcase") {
steps { stages {
dir('showcase') { stage("install showcase") {
nodejs('NodeJS (17.4.0)') { steps {
sh "npm i" dir('showcase') {
nodejs('NodeJS (17.4.0)') {
sh "npm i"
}
}
}
}
stage("build showcase") {
steps {
dir('showcase') {
nodejs('NodeJS (17.4.0)') {
sh "npm run build"
}
}
}
}
stage("deploy showcase") {
steps {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'showcase/dist', reportFiles: 'index.html', reportName: 'AudioShowKit Demo', reportTitles: ''])
} }
} }
} }
} }
stage("build showcase") { stage("generate docs") {
steps { steps {
dir('showcase') { dir('audioshowkit') {
nodejs('NodeJS (17.4.0)') { nodejs('NodeJS (17.4.0)') {
sh "npm run build" sh "npm run docs"
} }
} }
} publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'audioshowkit/docs', reportFiles: 'index.html', reportName: 'AudioShowKit JSDocs', reportTitles: ''])
}
stage("deploy showcase") {
steps {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'showcase/dist', reportFiles: 'index.html', reportName: 'AudioShowKit Demo', reportTitles: ''])
} }
} }
} }

3
showcase/.eslintignore Normal file
View File

@ -0,0 +1,3 @@
webpack.*.js
webpack.*.cjs
**/prism.js

36
showcase/.eslintrc.json Normal file
View File

@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:import/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"import/extensions": [
"error",
"ignorePackages"
]
}
}

View File

@ -0,0 +1,4 @@
{
"presets": [],
"plugins": []
}

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,15 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.17.9",
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"babel-loader": "^8.2.4",
"copy-webpack-plugin": "^10.2.4", "copy-webpack-plugin": "^10.2.4",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"eslint": "^8.13.0",
"eslint-plugin-import": "^2.26.0",
"eslint-webpack-plugin": "^3.1.1",
"html-loader": "^3.1.0", "html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",

View File

@ -1,6 +1,7 @@
const path = require("path"); const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin"); const CopyPlugin = require("copy-webpack-plugin");
const ESLintPlugin = require("eslint-webpack-plugin");
module.exports = { module.exports = {
entry: { entry: {
@ -33,6 +34,7 @@ module.exports = {
path: path.resolve("./dist") path: path.resolve("./dist")
}, },
plugins: [ plugins: [
new ESLintPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: path.resolve("./src/index.html"), template: path.resolve("./src/index.html"),
}), }),