Skip to content

Commit

Permalink
Move to WP5
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv2013 committed Jul 18, 2024
1 parent 6b4d612 commit 69d19a3
Show file tree
Hide file tree
Showing 9 changed files with 8,879 additions and 16,030 deletions.
12 changes: 5 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
module.exports = {
globals: {
"ts-jest": {
diagnostics: false,
tsconfig: "tsconfig.test.json"
}
},
testEnvironment: "jsdom",
reporters: [
"default",
[ "jest-junit", {
Expand All @@ -17,7 +12,10 @@ module.exports = {
coverageReporters: ["json", "lcov", "text", "html", "text-summary", "cobertura"],
roots: ["tests"],
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest"
"^.+\\.(ts|tsx)?$": [ "ts-jest", {
diagnostics: false,
tsconfig: "tsconfig.test.json"
}]
},
moduleNameMapper: {
"\\.(css|scss|html)$": "<rootDir>/tests/empty-module.js"
Expand Down
24,825 changes: 8,839 additions & 15,986 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 18 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"start": "webpack-dev-server --env.buildType dev",
"start": "webpack-dev-server --env buildType=dev",
"test": "jest",
"test_dev": "jest --watch",
"test_debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
Expand All @@ -10,9 +10,9 @@
"release": "standard-version --message \"Release: %s [azurepipelines skip]\" ",
"doc_gen": "node doc_generator/lib_docgenerator.js src/index.ts",
"doc_update": "chmod +x ./docupdate_npm.sh && ./docupdate_npm.sh",
"watch:dev": "webpack --env.buildType dev --watch",
"build:dev": "webpack --env.buildType dev",
"build:prod": "npm run build:dev && webpack --env.buildType prod",
"watch:dev": "webpack --env buildType=dev --watch",
"build:dev": "webpack --env buildType=dev",
"build:prod": "npm run build:dev && webpack --env buildType=prod",
"build": "npm run build:prod",
"build:types:summary": "tsc --p tsconfig.summary.json && echo \"export * from './survey-analytics.types/entries/summary';\" >> packages/survey.analytics.d.ts",
"build:types:datatables": "tsc --p tsconfig.datatables.json && echo \"export * from './survey-analytics-datatables.types/entries/datatables';\" >> packages/survey.analytics.datatables.d.ts",
Expand Down Expand Up @@ -73,36 +73,33 @@
"ajv": "6.12.3",
"colors": "1.4.0",
"concurrently": "^5.3.0",
"css-loader": "^3.6.0",
"css-loader": "^7.1.2",
"dotenv": "4.0.0",
"eslint": "^7.32.0",
"github-api": "^3.4.0",
"html-loader": "^0.4.4",
"http-server": "^0.12.3",
"html-loader": "^5.0.0",
"http-server": "^14.1.1",
"husky": "^8.0.3",
"jest": "^26.6.3",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"live-server": "^1.2.1",
"mini-css-extract-plugin": "^0.9.0",
"sass": "^1",
"mini-css-extract-plugin": "^2.9.0",
"node-uuid": "1.4.7",
"replace-in-file": "^6.3.2",
"rimraf": "2.5.4",
"sass": "^1",
"sass-loader": "^8.0.2",
"standard-version": "^8.0.2",
"standard-version": "^9.5.0",
"style-loader": "^1.3.0",
"surveyjs-doc-generator": "git+https://github.com/surveyjs/surveyjs-doc-generator.git",
"testcafe": "^1.18.4",
"testcafe-reporter-dashboard": "^0.2.10",
"ts-jest": "^26.5.6",
"testcafe": "^3.6.2",
"ts-jest": "^29.2.2",
"ts-loader": "^8.0.0",
"typescript": "^4.8.0",
"url-loader": "0.6.2",
"val-loader": "0.5.0",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "~5",
"url-loader": "^4.1.1",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"webpack-svgstore-plugin": "^4.1.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/tables/datatables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { DocumentHelper } from "../utils";
var styles = require("./datatables.scss");

if (!!document) {
var svgTemplate = require("html-loader?interpolate!val-loader!../svgbundle.html");
var svgTemplate = require("../svgbundle.html");
var templateHolder = document.createElement("div");
templateHolder.style.display = "none";
templateHolder.innerHTML = svgTemplate;
templateHolder.innerHTML = svgTemplate.default;
document.head.appendChild(templateHolder);
}

Expand Down
2 changes: 1 addition & 1 deletion src/tables/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
}

select {
@include dropdown();
line-height: initial;
@include dropdown();
}

input {
Expand Down
4 changes: 2 additions & 2 deletions src/tables/tabulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { ARIAL_FONT } from "./custom_jspdf_font";
var styles = require("./tabulator.scss");

if (!!document) {
const svgTemplate = require("html-loader?interpolate!val-loader!../svgbundle.html");
const svgTemplate = require("../svgbundle.html");
const templateHolder = document.createElement("div");
templateHolder.style.display = "none";
templateHolder.innerHTML = svgTemplate;
templateHolder.innerHTML = svgTemplate.default;
document.head.appendChild(templateHolder);
}

Expand Down
2 changes: 1 addition & 1 deletion src/visualizationPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@
cursor: pointer;
border: 1px solid transparent;
white-space: nowrap;
margin: 0 10px;

&:hover {
border-color: $border-color;
background-blend-mode: darken;
}
margin: 0 10px;
&:first-child {
margin-left: 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/visualizationPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const questionElementClassName = "sa-question";
const questionLayoutedElementClassName = "sa-question-layouted";

if (!!document) {
const svgTemplate = require("html-loader?interpolate!val-loader!./svgbundle.html");
const svgTemplate = require("./svgbundle.html");
const templateHolder = document.createElement("div");
templateHolder.style.display = "none";
templateHolder.innerHTML = svgTemplate;
templateHolder.innerHTML = svgTemplate.default;
document.head.appendChild(templateHolder);
}

Expand Down
17 changes: 9 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var webpack = require("webpack");
var path = require("path");
var fs = require("fs");
var rimraf = require("rimraf");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");

var packageJson = require("./package.json");
Expand Down Expand Up @@ -132,13 +131,11 @@ module.exports = function (options) {
rules: [
{
test: /\.(ts)$/,
use: {
loader: "ts-loader",
},
loader: "ts-loader",
},
{
test: /\.scss$/,
loader: [
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
Expand Down Expand Up @@ -209,7 +206,7 @@ module.exports = function (options) {
},
plugins: [
new PascalCaseNamePlugin(),
new webpack.WatchIgnorePlugin([/svgbundle\.html/]),
new webpack.WatchIgnorePlugin({ paths: [/svgbundle\.html/] }),
new webpack.ProgressPlugin(percentage_handler),
new webpack.DefinePlugin({
"process.env.ENVIRONMENT": JSON.stringify(options.buildType),
Expand All @@ -222,14 +219,18 @@ module.exports = function (options) {
banner: banner,
}),
],
devtool: "inline-source-map",
devServer: {
static: {
directory: path.join(__dirname, '.'),
},
},
};

if (isProductionBuild) {
config.devtool = false;
config.plugins = config.plugins.concat([]);
} else {
config.devtool = "inline-source-map";
config.devtool = "source-map";
config.plugins = config.plugins.concat([
new webpack.LoaderOptionsPlugin({ debug: true }),
]);
Expand Down

0 comments on commit 69d19a3

Please sign in to comment.