Skip to content

Commit

Permalink
Resolved #7131 - Add themes build to jQuery and survey-vue packages a…
Browse files Browse the repository at this point in the history
…nd fix examples code (use import from /themes)
  • Loading branch information
tsv2013 committed Oct 16, 2023
1 parent cfcd396 commit 9741cc6
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 5 deletions.
17 changes: 17 additions & 0 deletions build-scripts/survey-jquery/tsconfig.plugins.themes.typing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"survey-core": [
"../../build/survey-core"
]
},
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "../../build/survey-jquery/themes/typings/"
},
"include": [
"../../src/themes/index.ts"
]
}
77 changes: 77 additions & 0 deletions build-scripts/survey-jquery/webpack.themes.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"use strict";

const webpackCommonConfigCreator = require("../webpack.common");
const { merge } = require("webpack-merge");
var FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const DtsGeneratorPlugin = require("../webpack-dts-generator");
var path = require("path");

const config = {
entry: {
"default-light": path.resolve(__dirname, "../../src/themes/default-light.ts"),
"default-dark": path.resolve(__dirname, "../../src/themes/default-dark.ts"),
"default-light-panelless": path.resolve(__dirname, "../../src/themes/default-light-panelless.ts"),
"default-dark-panelless": path.resolve(__dirname, "../../src/themes/default-dark-panelless.ts"),
"sharp-light": path.resolve(__dirname, "../../src/themes/sharp-light.ts"),
"sharp-dark": path.resolve(__dirname, "../../src/themes/sharp-dark.ts"),
"sharp-light-panelless": path.resolve(__dirname, "../../src/themes/sharp-light-panelless.ts"),
"sharp-dark-panelless": path.resolve(__dirname, "../../src/themes/sharp-dark-panelless.ts"),
"borderless-light": path.resolve(__dirname, "../../src/themes/borderless-light.ts"),
"borderless-dark": path.resolve(__dirname, "../../src/themes/borderless-dark.ts"),
"borderless-light-panelless.": path.resolve(__dirname, "../../src/themes/borderless-light-panelless.ts"),
"borderless-dark-panelless": path.resolve(__dirname, "../../src/themes/borderless-dark-panelless.ts"),
"flat-light": path.resolve(__dirname, "../../src/themes/flat-light.ts"),
"flat-dark": path.resolve(__dirname, "../../src/themes/flat-dark.ts"),
"flat-light-panelless": path.resolve(__dirname, "../../src/themes/flat-light-panelless.ts"),
"flat-dark-panelless": path.resolve(__dirname, "../../src/themes/flat-dark-panelless.ts"),
"plain-light": path.resolve(__dirname, "../../src/themes/plain-light.ts"),
"plain-dark": path.resolve(__dirname, "../../src/themes/plain-dark.ts"),
"plain-light-panelless": path.resolve(__dirname, "../../src/themes/plain-light-panelless.ts"),
"plain-dark-panelless": path.resolve(__dirname, "../../src/themes/plain-dark-panelless.ts"),
"doubleborder-light": path.resolve(__dirname, "../../src/themes/doubleborder-light.ts"),
"doubleborder-dark": path.resolve(__dirname, "../../src/themes/doubleborder-dark.ts"),
"doubleborder-light-panelles": path.resolve(__dirname, "../../src/themes/doubleborder-light-panelless.ts"),
"doubleborder-dark-panelless": path.resolve(__dirname, "../../src/themes/doubleborder-dark-panelless.ts"),
"layered-light": path.resolve(__dirname, "../../src/themes/layered-light.ts"),
"layered-dark": path.resolve(__dirname, "../../src/themes/layered-dark.ts"),
"layered-light-panelless": path.resolve(__dirname, "../../src/themes/layered-light-panelless.ts"),
"layered-dark-panelless": path.resolve(__dirname, "../../src/themes/layered-dark-panelless.ts"),
"solid-light": path.resolve(__dirname, "../../src/themes/solid-light.ts"),
"solid-dark": path.resolve(__dirname, "../../src/themes/solid-dark.ts"),
"solid-light-panelless": path.resolve(__dirname, "../../src/themes/solid-light-panelless.ts"),
"solid-dark-panelless": path.resolve(__dirname, "../../src/themes/solid-dark-panelless.ts"),
"three-dimensional-light": path.resolve(__dirname, "../../src/themes/threedimensional-light.ts"),
"three-dimensional-dark": path.resolve(__dirname, "../../src/themes/threedimensional-dark.ts"),
"three-dimensional-light-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-light-panelless.ts"),
"three-dimensional-dark-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-dark-panelless.ts"),
"contrast-light": path.resolve(__dirname, "../../src/themes/contrast-light.ts"),
"contrast-dark": path.resolve(__dirname, "../../src/themes/contrast-dark.ts"),
"contrast-light-panelless": path.resolve(__dirname, "../../src/themes/contrast-light-panelless.ts"),
"contrast-dark-panelless": path.resolve(__dirname, "../../src/themes/contrast-dark-panelless.ts"),
"index": path.resolve(__dirname, "../../src/themes/index.ts"),
},
plugins: [new FixStyleOnlyEntriesPlugin()],
externals: {
"survey-core": {
root: "Survey",
commonjs2: "survey-core",
commonjs: "survey-core",
amd: "survey-core"
}
}
};

module.exports = function (options) {
options.platform = "";
options.libraryName = "SurveyTheme";
if (options.buildType !== "prod") {
config.plugins.push(new DtsGeneratorPlugin({
tsConfigPath: "./build-scripts/survey-jquery/tsconfig.plugins.themes.typing.json",
filePath: "build/survey-jquery/themes/index.d.ts",
moduleName: "survey-jquery/themes",
importName: "index"
}));
}

return merge(webpackCommonConfigCreator(options, { "name": "survey-themes" }, "survey.themes", "survey-jquery/themes"), config);
};
17 changes: 17 additions & 0 deletions build-scripts/survey-vue/tsconfig.plugins.themes.typing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"survey-core": [
"../../build/survey-core"
]
},
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "../../build/survey-vue/themes/typings/"
},
"include": [
"../../src/themes/index.ts"
]
}
77 changes: 77 additions & 0 deletions build-scripts/survey-vue/webpack.themes.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"use strict";

const webpackCommonConfigCreator = require("../webpack.common");
const { merge } = require("webpack-merge");
var FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const DtsGeneratorPlugin = require("../webpack-dts-generator");
var path = require("path");

const config = {
entry: {
"default-light": path.resolve(__dirname, "../../src/themes/default-light.ts"),
"default-dark": path.resolve(__dirname, "../../src/themes/default-dark.ts"),
"default-light-panelless": path.resolve(__dirname, "../../src/themes/default-light-panelless.ts"),
"default-dark-panelless": path.resolve(__dirname, "../../src/themes/default-dark-panelless.ts"),
"sharp-light": path.resolve(__dirname, "../../src/themes/sharp-light.ts"),
"sharp-dark": path.resolve(__dirname, "../../src/themes/sharp-dark.ts"),
"sharp-light-panelless": path.resolve(__dirname, "../../src/themes/sharp-light-panelless.ts"),
"sharp-dark-panelless": path.resolve(__dirname, "../../src/themes/sharp-dark-panelless.ts"),
"borderless-light": path.resolve(__dirname, "../../src/themes/borderless-light.ts"),
"borderless-dark": path.resolve(__dirname, "../../src/themes/borderless-dark.ts"),
"borderless-light-panelless.": path.resolve(__dirname, "../../src/themes/borderless-light-panelless.ts"),
"borderless-dark-panelless": path.resolve(__dirname, "../../src/themes/borderless-dark-panelless.ts"),
"flat-light": path.resolve(__dirname, "../../src/themes/flat-light.ts"),
"flat-dark": path.resolve(__dirname, "../../src/themes/flat-dark.ts"),
"flat-light-panelless": path.resolve(__dirname, "../../src/themes/flat-light-panelless.ts"),
"flat-dark-panelless": path.resolve(__dirname, "../../src/themes/flat-dark-panelless.ts"),
"plain-light": path.resolve(__dirname, "../../src/themes/plain-light.ts"),
"plain-dark": path.resolve(__dirname, "../../src/themes/plain-dark.ts"),
"plain-light-panelless": path.resolve(__dirname, "../../src/themes/plain-light-panelless.ts"),
"plain-dark-panelless": path.resolve(__dirname, "../../src/themes/plain-dark-panelless.ts"),
"doubleborder-light": path.resolve(__dirname, "../../src/themes/doubleborder-light.ts"),
"doubleborder-dark": path.resolve(__dirname, "../../src/themes/doubleborder-dark.ts"),
"doubleborder-light-panelles": path.resolve(__dirname, "../../src/themes/doubleborder-light-panelless.ts"),
"doubleborder-dark-panelless": path.resolve(__dirname, "../../src/themes/doubleborder-dark-panelless.ts"),
"layered-light": path.resolve(__dirname, "../../src/themes/layered-light.ts"),
"layered-dark": path.resolve(__dirname, "../../src/themes/layered-dark.ts"),
"layered-light-panelless": path.resolve(__dirname, "../../src/themes/layered-light-panelless.ts"),
"layered-dark-panelless": path.resolve(__dirname, "../../src/themes/layered-dark-panelless.ts"),
"solid-light": path.resolve(__dirname, "../../src/themes/solid-light.ts"),
"solid-dark": path.resolve(__dirname, "../../src/themes/solid-dark.ts"),
"solid-light-panelless": path.resolve(__dirname, "../../src/themes/solid-light-panelless.ts"),
"solid-dark-panelless": path.resolve(__dirname, "../../src/themes/solid-dark-panelless.ts"),
"three-dimensional-light": path.resolve(__dirname, "../../src/themes/threedimensional-light.ts"),
"three-dimensional-dark": path.resolve(__dirname, "../../src/themes/threedimensional-dark.ts"),
"three-dimensional-light-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-light-panelless.ts"),
"three-dimensional-dark-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-dark-panelless.ts"),
"contrast-light": path.resolve(__dirname, "../../src/themes/contrast-light.ts"),
"contrast-dark": path.resolve(__dirname, "../../src/themes/contrast-dark.ts"),
"contrast-light-panelless": path.resolve(__dirname, "../../src/themes/contrast-light-panelless.ts"),
"contrast-dark-panelless": path.resolve(__dirname, "../../src/themes/contrast-dark-panelless.ts"),
"index": path.resolve(__dirname, "../../src/themes/index.ts"),
},
plugins: [new FixStyleOnlyEntriesPlugin()],
externals: {
"survey-core": {
root: "Survey",
commonjs2: "survey-core",
commonjs: "survey-core",
amd: "survey-core"
}
}
};

module.exports = function (options) {
options.platform = "";
options.libraryName = "SurveyTheme";
if (options.buildType !== "prod") {
config.plugins.push(new DtsGeneratorPlugin({
tsConfigPath: "./build-scripts/survey-vue/tsconfig.plugins.themes.typing.json",
filePath: "build/survey-vue/themes/index.d.ts",
moduleName: "survey-vue/themes",
importName: "index"
}));
}

return merge(webpackCommonConfigCreator(options, { "name": "survey-themes" }, "survey.themes", "survey-vue/themes"), config);
};
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"build_knockout_prod": "webpack --config ./build-scripts/survey-knockout/webpack.config.js --env.buildType prod",
"build_react_dev": "webpack --config ./build-scripts/survey-react/webpack.config.js --env.buildType dev",
"build_react_prod": "webpack --config ./build-scripts/survey-react/webpack.config.js --env.buildType prod",
"build_vue_dev": "webpack --config ./build-scripts/survey-vue/webpack.config.js --env.buildType dev",
"build_vue_prod": "webpack --config ./build-scripts/survey-vue/webpack.config.js --env.buildType prod",
"build_jquery_dev": "webpack --config ./build-scripts/survey-jquery/webpack.config.js --env.buildType dev",
"build_jquery_prod": "webpack --config ./build-scripts/survey-jquery/webpack.config.js --env.buildType prod",
"build_vue_dev": "webpack --config ./build-scripts/survey-vue/webpack.config.js --env.buildType dev && webpack --config ./build-scripts/survey-vue/webpack.themes.config.js --env.buildType dev",
"build_vue_prod": "webpack --config ./build-scripts/survey-vue/webpack.config.js --env.buildType prod && webpack --config ./build-scripts/survey-vue/webpack.themes.config.js --env.buildType prod",
"build_jquery_dev": "webpack --config ./build-scripts/survey-jquery/webpack.config.js --env.buildType dev && webpack --config ./build-scripts/survey-jquery/webpack.themes.config.js --env.buildType dev",
"build_jquery_prod": "webpack --config ./build-scripts/survey-jquery/webpack.config.js --env.buildType prod && webpack --config ./build-scripts/survey-jquery/webpack.themes.config.js --env.buildType prod",
"build_angular_dev": "webpack --config ./build-scripts/survey-angular/webpack.config.js --env.buildType dev",
"build_angular_prod": "webpack --config ./build-scripts/survey-angular/webpack.config.js --env.buildType prod",
"build_i18n_dev": "webpack --config ./build-scripts/survey-core/webpack.i18n.js --env.buildType dev",
Expand Down Expand Up @@ -196,4 +196,4 @@
"signature_pad": "^4.1.5",
"vite": "^3.1.8"
}
}
}

0 comments on commit 9741cc6

Please sign in to comment.