diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d8abb3e7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 160 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false diff --git a/.gitignore b/.gitignore index 5fb21292..4836941f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,13 @@ -work/ -.idea/ -target/ -test-output/ -.idea/ -.classpath -.settings/ -.project -**/*~ -*.iml +work/ +.idea/ +target/ +test-output/ +.classpath +.settings/ +.project +**/*~ +*.iml +node/ +node_modules/ +src/main/resources/org/biouno/unochoice/stapler/unochoice/*.js +src/main/resources/org/biouno/unochoice/stapler/unochoice/*.js.map \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..b60030d0 --- /dev/null +++ b/package.json @@ -0,0 +1,66 @@ +{ + "license": "MIT", + "version": "1.0.0", + "description": "Active Choices Plugin UI", + "name": "uno-choice", + "private": true, + "scripts": { + "test": "jest", + "dev": "webpack --config webpack.config.js", + "prod": "webpack --config webpack.config.js --mode=production", + "build": "yarn prod" + }, + "devDependencies": { + "@babel/cli": "^7.22.5", + "@babel/core": "7.22.5", + "@babel/preset-env": "^7.22.5", + "@babel/preset-typescript": "^7.22.5", + "@babel/preset-flow": "^7.22.5", + "eslint": "8.43.0", + "eslint-config-prettier": "8.8.0", + "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", + "jest-junit": "^16.0.0", + "jsdom": "^22.1.0", + "prettier": "2.8.8", + "ts-loader": "^9.4.3", + "typescript": "^5.1.3", + "webpack": "5.87.0", + "webpack-cli": "5.1.4", + "jquery": "^3.7.0", + "@types/jquery": "^3.5.16" + }, + "dependencies": { + }, + "browserslist": [ + "defaults", + "not IE 11" + ], + "packageManager": "yarn@3.6.0", + "jest-junit": { + "outputDirectory": "target/surefire-reports", + "outputName": "TEST-Jest.xml", + "ancestorSeparator": " › ", + "classNameTemplate": "{classname}", + "titleTemplate": "{title}", + "usePathForSuiteName": "true" + }, + "babel": { + "presets": [ + ["@babel/preset-env", {"targets": {"node": "current"}}], + "@babel/preset-typescript", + "@babel/preset-flow" + ] + }, + "jest": { + "verbose": true, + "testEnvironment": "jsdom", + "reporters": [ + "default", + "jest-junit" + ], + "testMatch": [ + "/src/test/js/*.test.ts" + ] + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8cb94478..54f575dd 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,8 @@ -SNAPSHOT 2.332.4 jenkinsci/active-choices-plugin + 18.16.0 + 1.22.19 @@ -202,6 +204,59 @@ 2.0 + + + com.github.eirslett + frontend-maven-plugin + 1.12.1 + + + + install node and yarn + + install-node-and-yarn + + initialize + + v${node.version} + v${yarn.version} + https://repo.jenkins-ci.org/nodejs-dist/ + + + + + + yarn-install + + yarn + + initialize + + + + yarn-build + + yarn + + generate-resources + + build + + + + + yarn-test + + yarn + + test + + test + + + + + diff --git a/src/main/resources/org/biouno/unochoice/stapler/unochoice.jelly b/src/main/resources/org/biouno/unochoice/stapler/unochoice.jelly index 658b8566..0cf92482 100644 --- a/src/main/resources/org/biouno/unochoice/stapler/unochoice.jelly +++ b/src/main/resources/org/biouno/unochoice/stapler/unochoice.jelly @@ -22,5 +22,5 @@ Use it like align-items: flex-start; } -