From 4fa7c1cad4427e543266faee1c8dc77e826379d8 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Wed, 17 Jul 2024 15:58:47 +0300 Subject: [PATCH 1/2] Started new package survey-js-ui --- build-packages.yml | 10 +++++----- .../{survey-ui => survey-js-ui}/README.md | 0 .../{survey-ui => survey-js-ui}/package.json | 11 +++++------ .../{survey-ui => survey-js-ui}/tsconfig.json | 0 .../tsconfig.typing.ui.json | 2 +- .../{survey-ui => survey-js-ui}/webpack.config.js | 12 ++++++------ devops-pull-requests-parallel-jobs.yml | 6 +++--- devops-visual-regression-tests.yml | 6 +++--- examples/{survey-ui => survey-js-ui}/index.html | 2 +- examples/{survey-ui => survey-js-ui}/index.js | 0 .../{survey-ui.html => survey-js-ui.html} | 2 +- .../{survey-ui.html => survey-js-ui.html} | 2 +- .../default/{survey-ui.html => survey-js-ui.html} | 2 +- .../{survey-ui.html => survey-js-ui.html} | 2 +- .../modern/{survey-ui.html => survey-js-ui.html} | 2 +- package.json | 14 +++++++------- src/entries/{ui.ts => js-ui.ts} | 4 ++-- testCafe/helper.js | 10 +++++----- testCafe/survey/customCss.js | 2 +- testCafe/survey/popup.js | 2 +- visual-regression-tests.yml | 6 +++--- .../tests/defaultV2/buttongroup.ts | 6 +++--- 22 files changed, 51 insertions(+), 52 deletions(-) rename build-scripts/{survey-ui => survey-js-ui}/README.md (100%) rename build-scripts/{survey-ui => survey-js-ui}/package.json (79%) rename build-scripts/{survey-ui => survey-js-ui}/tsconfig.json (100%) rename build-scripts/{survey-ui => survey-js-ui}/tsconfig.typing.ui.json (95%) rename build-scripts/{survey-ui => survey-js-ui}/webpack.config.js (79%) rename examples/{survey-ui => survey-js-ui}/index.html (92%) rename examples/{survey-ui => survey-js-ui}/index.js (100%) rename examples_test/bootstrap/{survey-ui.html => survey-js-ui.html} (91%) rename examples_test/customWidget/{survey-ui.html => survey-js-ui.html} (96%) rename examples_test/default/{survey-ui.html => survey-js-ui.html} (91%) rename examples_test/defaultV2/{survey-ui.html => survey-js-ui.html} (89%) rename examples_test/modern/{survey-ui.html => survey-js-ui.html} (89%) rename src/entries/{ui.ts => js-ui.ts} (93%) diff --git a/build-packages.yml b/build-packages.yml index ab6c257570..680322f0e3 100644 --- a/build-packages.yml +++ b/build-packages.yml @@ -953,18 +953,18 @@ jobs: - script: | cd $(Build.SourcesDirectory)/survey-library - npm run build_ui - displayName: "Build survey-ui" + npm run build_js_ui + displayName: "Build survey-js-ui" - script: | cd $(Build.SourcesDirectory)/survey-library - npm run testcafe:survey-ui:ci + npm run testcafe:survey-js-ui:ci displayName: "run functional tests" - task: CopyFiles@2 inputs: - SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-ui" - TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-ui" + SourceFolder: "$(Build.SourcesDirectory)/survey-library/build/survey-js-ui" + TargetFolder: "$(Build.ArtifactStagingDirectory)/SurveyJSLibraryBuild/packages/survey-js-ui" - task: PublishBuildArtifacts@1 inputs: diff --git a/build-scripts/survey-ui/README.md b/build-scripts/survey-js-ui/README.md similarity index 100% rename from build-scripts/survey-ui/README.md rename to build-scripts/survey-js-ui/README.md diff --git a/build-scripts/survey-ui/package.json b/build-scripts/survey-js-ui/package.json similarity index 79% rename from build-scripts/survey-ui/package.json rename to build-scripts/survey-js-ui/package.json index a9fc567993..aa131ec35c 100644 --- a/build-scripts/survey-ui/package.json +++ b/build-scripts/survey-js-ui/package.json @@ -1,6 +1,6 @@ { - "name": "survey-ui", - "version": "1.8.33", + "name": "survey-js-ui", + "version": "1.11.7", "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.", "keywords": [ "Survey", @@ -15,14 +15,13 @@ "files": [ "**/*" ], - "main": "survey-ui.js", + "main": "survey-js-ui.js", "repository": { "type": "git", "url": "https://github.com/surveyjs/surveyjs.git" }, - "typings": "survey-ui.d.ts", - "dependencies": { - }, + "typings": "survey-js-ui.d.ts", + "dependencies": {}, "peerDependencies": { "survey-core": "*" } diff --git a/build-scripts/survey-ui/tsconfig.json b/build-scripts/survey-js-ui/tsconfig.json similarity index 100% rename from build-scripts/survey-ui/tsconfig.json rename to build-scripts/survey-js-ui/tsconfig.json diff --git a/build-scripts/survey-ui/tsconfig.typing.ui.json b/build-scripts/survey-js-ui/tsconfig.typing.ui.json similarity index 95% rename from build-scripts/survey-ui/tsconfig.typing.ui.json rename to build-scripts/survey-js-ui/tsconfig.typing.ui.json index 1df84628e4..48da91b455 100644 --- a/build-scripts/survey-ui/tsconfig.typing.ui.json +++ b/build-scripts/survey-js-ui/tsconfig.typing.ui.json @@ -27,7 +27,7 @@ "skipLibCheck": true }, "include": [ - "../../src/entries/ui.ts", + "../../src/entries/js-ui.ts", "../../src/entries/react-ui-model.ts" ], } \ No newline at end of file diff --git a/build-scripts/survey-ui/webpack.config.js b/build-scripts/survey-js-ui/webpack.config.js similarity index 79% rename from build-scripts/survey-ui/webpack.config.js rename to build-scripts/survey-js-ui/webpack.config.js index 036e3ff120..cf22bf09f3 100644 --- a/build-scripts/survey-ui/webpack.config.js +++ b/build-scripts/survey-js-ui/webpack.config.js @@ -32,16 +32,16 @@ const config = { }, plugins: [ new DtsGeneratorPlugin({ - tsConfigPath: "./build-scripts/survey-ui/tsconfig.typing.ui.json", - filePath: "build/survey-ui/survey-ui.d.ts", - moduleName: "survey-ui", - importName: "entries/ui" + tsConfigPath: "./build-scripts/survey-js-ui/tsconfig.typing.ui.json", + filePath: "build/survey-js-ui/survey-js-ui.d.ts", + moduleName: "survey-js-ui", + importName: "entries/js-ui" }), ], }; module.exports = function (options) { - options.platform = "ui"; + options.platform = "js-ui"; options.libraryName = "SurveyUI"; - return merge(webpackCommonConfigCreator(options, packageJson, "survey-ui"), config); + return merge(webpackCommonConfigCreator(options, packageJson, "survey-js-ui"), config); } diff --git a/devops-pull-requests-parallel-jobs.yml b/devops-pull-requests-parallel-jobs.yml index 20a05a6435..3f820b2ed7 100644 --- a/devops-pull-requests-parallel-jobs.yml +++ b/devops-pull-requests-parallel-jobs.yml @@ -394,9 +394,9 @@ jobs: displayName: "Build Core" - script: | - npm run build_ui_prod - displayName: "Build survey-ui" + npm run build_js_ui_prod + displayName: "Build survey-js-ui" - script: | - npm run testcafe:survey-ui:ci + npm run testcafe:survey-js-ui:ci displayName: "run functional tests" diff --git a/devops-visual-regression-tests.yml b/devops-visual-regression-tests.yml index 828b6e4f62..ecabff7d97 100644 --- a/devops-visual-regression-tests.yml +++ b/devops-visual-regression-tests.yml @@ -486,11 +486,11 @@ jobs: displayName: "Build Core" - script: | - npm run build_ui_prod - displayName: "Build survey-ui" + npm run build_js_ui_prod + displayName: "Build survey-js-ui" - script: | - npm run vrt:survey-ui:ci + npm run vrt:survey-js-ui:ci displayName: "Visual Regression Tests" - task: CopyFiles@2 diff --git a/examples/survey-ui/index.html b/examples/survey-js-ui/index.html similarity index 92% rename from examples/survey-ui/index.html rename to examples/survey-js-ui/index.html index de0c43d1ff..56e898e5d0 100644 --- a/examples/survey-ui/index.html +++ b/examples/survey-js-ui/index.html @@ -12,7 +12,7 @@ - + diff --git a/examples/survey-ui/index.js b/examples/survey-js-ui/index.js similarity index 100% rename from examples/survey-ui/index.js rename to examples/survey-js-ui/index.js diff --git a/examples_test/bootstrap/survey-ui.html b/examples_test/bootstrap/survey-js-ui.html similarity index 91% rename from examples_test/bootstrap/survey-ui.html rename to examples_test/bootstrap/survey-js-ui.html index 7b33baffc1..fed8a128b5 100644 --- a/examples_test/bootstrap/survey-ui.html +++ b/examples_test/bootstrap/survey-js-ui.html @@ -11,7 +11,7 @@ - +
diff --git a/examples_test/customWidget/survey-ui.html b/examples_test/customWidget/survey-js-ui.html similarity index 96% rename from examples_test/customWidget/survey-ui.html rename to examples_test/customWidget/survey-js-ui.html index 9e621d3d31..f1ffe5e13a 100644 --- a/examples_test/customWidget/survey-ui.html +++ b/examples_test/customWidget/survey-js-ui.html @@ -13,7 +13,7 @@ - + diff --git a/examples_test/default/survey-ui.html b/examples_test/default/survey-js-ui.html similarity index 91% rename from examples_test/default/survey-ui.html rename to examples_test/default/survey-js-ui.html index a36af41a56..46b7c5d8a0 100644 --- a/examples_test/default/survey-ui.html +++ b/examples_test/default/survey-js-ui.html @@ -11,7 +11,7 @@ - + diff --git a/examples_test/defaultV2/survey-ui.html b/examples_test/defaultV2/survey-js-ui.html similarity index 89% rename from examples_test/defaultV2/survey-ui.html rename to examples_test/defaultV2/survey-js-ui.html index 9def346062..a0a4f1b062 100644 --- a/examples_test/defaultV2/survey-ui.html +++ b/examples_test/defaultV2/survey-js-ui.html @@ -10,7 +10,7 @@ - +
diff --git a/examples_test/modern/survey-ui.html b/examples_test/modern/survey-js-ui.html similarity index 89% rename from examples_test/modern/survey-ui.html rename to examples_test/modern/survey-js-ui.html index cf47b46301..b5ec7b7b47 100644 --- a/examples_test/modern/survey-ui.html +++ b/examples_test/modern/survey-js-ui.html @@ -10,7 +10,7 @@ - +
diff --git a/package.json b/package.json index 757e2ae1a2..50282d37a0 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "testcafe:ko": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=knockout", "testcafe:jquery-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=jquery-ui", "testcafe:jquery-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=jquery-ui", - "testcafe:survey-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=survey-ui", - "testcafe:survey-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=survey-ui", + "testcafe:survey-js-ui": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome testCafe/ --app \"http-server --silent\" --env=survey-js-ui", + "testcafe:survey-js-ui:ci": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=survey-js-ui", "vrt:jquery-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=jquery-ui", - "vrt:survey-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-ui", + "vrt:survey-js-ui:ci": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=survey-js-ui", "testcafe:react": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=react", "testcafe:vue": "http-server --silent & testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --reporter minimal --env=vue", "release": "commit-and-tag-version --message \"Release: %s [azurepipelines skip]\" ", @@ -30,8 +30,8 @@ "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_jquery_ui_dev": "webpack --config ./build-scripts/survey-jquery-ui/webpack.config.js --env.buildType dev", "build_jquery_ui_prod": "webpack --config ./build-scripts/survey-jquery-ui/webpack.config.js --env.buildType prod", - "build_ui_dev": "webpack --config ./build-scripts/survey-ui/webpack.config.js --env.buildType dev", - "build_ui_prod": "webpack --config ./build-scripts/survey-ui/webpack.config.js --env.buildType prod", + "build_js_ui_dev": "webpack --config ./build-scripts/survey-js-ui/webpack.config.js --env.buildType dev", + "build_js_ui_prod": "webpack --config ./build-scripts/survey-js-ui/webpack.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", @@ -64,7 +64,7 @@ "build_i18n": "npm run build_i18n_dev && npm run build_i18n_prod", "build_jquery": "npm run build_jquery_dev && npm run build_jquery_prod", "build_jquery_ui": "npm run build_jquery_ui_dev && npm run build_jquery_ui_prod", - "build_ui": "npm run build_ui_dev && npm run build_ui_prod", + "build_js_ui": "npm run build_js_ui_dev && npm run build_js_ui_prod", "build_angular": "npm run build_angular_dev && npm run build_angular_prod && rimraf build/survey-angular/ts3.4 && downlevel-dts build/survey-angular build/survey-angular/ts3.4", "watch:core:dev": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType dev --watch", "watch:core:prod": "webpack --config ./build-scripts/survey-core/webpack.config.js --env.buildType prod --watch", @@ -228,4 +228,4 @@ "signature_pad": "^4.1.5", "vite": "^3.1.8" } -} +} \ No newline at end of file diff --git a/src/entries/ui.ts b/src/entries/js-ui.ts similarity index 93% rename from src/entries/ui.ts rename to src/entries/js-ui.ts index 52c79c4e10..054b5327e2 100644 --- a/src/entries/ui.ts +++ b/src/entries/js-ui.ts @@ -35,7 +35,7 @@ if (!!jQuery) { }); } -SurveyModel.platform = "ui"; +SurveyModel.platform = "js-ui"; SurveyModel.prototype["render"] = function (element: any = null) { if (this.renderCallback) { this.renderCallback(); @@ -53,4 +53,4 @@ export { SurveyModel as Model } from "survey-core"; import { checkLibraryVersion } from "survey-core"; -checkLibraryVersion(`${process.env.VERSION}`, "survey-ui"); \ No newline at end of file +checkLibraryVersion(`${process.env.VERSION}`, "survey-js-ui"); \ No newline at end of file diff --git a/testCafe/helper.js b/testCafe/helper.js index 9079983cef..886e7097fa 100644 --- a/testCafe/helper.js +++ b/testCafe/helper.js @@ -61,7 +61,7 @@ export const initSurvey = ClientFunction( window["$"]("#surveyElement").Survey({ model: model }); - } else if (framework === "survey-ui") { + } else if (framework === "survey-js-ui") { document.getElementById("surveyElement").innerHTML = ""; SurveyUI.renderSurvey(model, document.getElementById("surveyElement")); } else if (framework === "react") { @@ -120,7 +120,7 @@ export const initSurveyPopup = ClientFunction( allowClose: true, allowFullScreen: true }); - } else if (framework === "survey-ui") { + } else if (framework === "survey-js-ui") { document.getElementById("surveyElement").innerHTML = ""; SurveyUI.renderPopupSurvey(model, document.getElementById("surveyElement"), { isExpanded: true, @@ -190,7 +190,7 @@ export const registerCustomToolboxComponent = ClientFunction( return window["React"].createElement(CustomActionButton, props); } ); - } else if (framework === "jquery-ui" || framework === "survey-ui") { + } else if (framework === "jquery-ui" || framework === "survey-js-ui") { const preact = (window["SurveyJquery"] || window["SurveyUI"])["preact"]; window.React = { createElement: preact.createElement }; @@ -277,7 +277,7 @@ export const registerCustomItemComponent = ClientFunction( return window["React"].createElement(ItemTemplateComponent, props); } ); - } else if (framework === "jquery-ui" || framework === "survey-ui") { + } else if (framework === "jquery-ui" || framework === "survey-js-ui") { const preact = (window["SurveyJquery"] || window["SurveyUI"])["preact"]; window.React = { createElement: preact.createElement }; class ItemTemplateComponent extends preact.Component { @@ -397,7 +397,7 @@ export const registerCustomItemContentComponent = ClientFunction( return preact.createElement(ItemContentTemplateComponent, props); } ); - } else if (framework === "survey-ui") { + } else if (framework === "survey-js-ui") { const preact = window["SurveyUI"]["preact"]; window.React = { createElement: preact.createElement }; class ItemContentTemplateComponent extends preact.Component { diff --git a/testCafe/survey/customCss.js b/testCafe/survey/customCss.js index 1f690b7381..f5e2a2cec2 100644 --- a/testCafe/survey/customCss.js +++ b/testCafe/survey/customCss.js @@ -48,7 +48,7 @@ const initSurvey = ClientFunction((framework, json) => { window["$"]("#surveyElement").Survey({ model: model }); - } else if (framework === "survey-ui") { + } else if (framework === "survey-js-ui") { model.css = myCss; document.getElementById("surveyElement").innerHTML = ""; window["SurveyUI"].renderSurvey(model, document.getElementById("surveyElement")); diff --git a/testCafe/survey/popup.js b/testCafe/survey/popup.js index d4e4cee718..0e38e6f7ce 100644 --- a/testCafe/survey/popup.js +++ b/testCafe/survey/popup.js @@ -48,7 +48,7 @@ const initPopupSurvey = ClientFunction( window["$"]("#surveyElement").PopupSurvey({ model: model }); - } else if (framework === "survey-ui") { + } else if (framework === "survey-js-ui") { document.getElementById("surveyElement").innerHTML = ""; window["SurveyUI"].renderPopupSurvey(model, document.getElementById("surveyElement")); } diff --git a/visual-regression-tests.yml b/visual-regression-tests.yml index 864bbd7663..23dfea7ac8 100644 --- a/visual-regression-tests.yml +++ b/visual-regression-tests.yml @@ -487,11 +487,11 @@ jobs: displayName: "Build Core" - script: | - npm run build_ui_prod - displayName: "Build survey-ui" + npm run build_js_ui_prod + displayName: "Build survey-js-ui" - script: | - npm run vrt:survey-ui:ci + npm run vrt:survey-js-ui:ci displayName: "Visual Regression Tests" - task: CopyFiles@2 diff --git a/visualRegressionTests/tests/defaultV2/buttongroup.ts b/visualRegressionTests/tests/defaultV2/buttongroup.ts index 480451c0d3..4d18189cf1 100644 --- a/visualRegressionTests/tests/defaultV2/buttongroup.ts +++ b/visualRegressionTests/tests/defaultV2/buttongroup.ts @@ -30,7 +30,7 @@ const registerButtongroup = ClientFunction((framework) => { return preact.createElement(SurveyJquery.SurveyQuestionButtonGroup, props); }); } - if (framework === "survey-ui") { + if (framework === "survey-js-ui") { const SurveyUI = (window).SurveyUI; const preact = SurveyUI["preact"]; SurveyUI.ReactQuestionFactory.Instance.registerQuestion("buttongroup", props => { @@ -54,8 +54,8 @@ const registerButtongroup = ClientFunction((framework) => { frameworks.forEach(framework => { fixture`${framework} ${title} ${theme}` .page`${url_test}${theme}/${framework}`.beforeEach(async t => { - await applyTheme(theme); - }); + await applyTheme(theme); + }); test("Check buttongroup question", async (t) => { await wrapVisualTest(t, async (t, comparer) => { await t.resizeWindow(1920, 1080); From eaad94c5d01a2229a74473ea94c3a2dfd51553e5 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Wed, 17 Jul 2024 16:05:22 +0300 Subject: [PATCH 2/2] Fixed lint --- visualRegressionTests/tests/defaultV2/buttongroup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visualRegressionTests/tests/defaultV2/buttongroup.ts b/visualRegressionTests/tests/defaultV2/buttongroup.ts index 4d18189cf1..1d5cc95b24 100644 --- a/visualRegressionTests/tests/defaultV2/buttongroup.ts +++ b/visualRegressionTests/tests/defaultV2/buttongroup.ts @@ -54,8 +54,8 @@ const registerButtongroup = ClientFunction((framework) => { frameworks.forEach(framework => { fixture`${framework} ${title} ${theme}` .page`${url_test}${theme}/${framework}`.beforeEach(async t => { - await applyTheme(theme); - }); + await applyTheme(theme); + }); test("Check buttongroup question", async (t) => { await wrapVisualTest(t, async (t, comparer) => { await t.resizeWindow(1920, 1080);