diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index f4ebe99e32..eb51f61c94 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: ssh-fingerprint: type: string - default: "SHA256:r/0YTSpeTcY6psL0RvgtmDjZJB+raeTcfd/5bcQQ2DQ" + default: 'SHA256:r/0YTSpeTcY6psL0RvgtmDjZJB+raeTcfd/5bcQQ2DQ' build-apps: type: boolean default: false @@ -21,14 +21,14 @@ defaults: - vfcommon/notify_slack: channel: dev_general event: fail - mentions: "@eng_platform" + mentions: '@eng_platform' template: basic_fail_1 branch_pattern: master executors: playwright: docker: - - image: mcr.microsoft.com/playwright:v1.41.1-jammy + - image: mcr.microsoft.com/playwright:v1.43.1-jammy jobs: test: # Main unit, style, and dependency tests @@ -41,16 +41,25 @@ jobs: avoid_post_install_scripts: false - vfcommon/monorepo_lint_report: run_on_root: true + - vfcommon/monorepo_types_tests: + run_on_root: true - vfcommon/monorepo_dependency_tests: run_on_root: true - vfcommon/monorepo_unit_tests: run_on_root: true + - run: + name: Collect test reports + command: | + # copy all .report.xml files to the root directory + # and give them unique names based on their paths + find . -type f -name "*.report.xml" | xargs -I {} sh -c 'cp {} reports/$(echo {} | cut -c 3- | tr "/" "_")' + - store_test_results: + path: './reports' - vfcommon/monorepo_save_cache: - package: "all" - monorepo_engine: "turborepo" - cache_identifier: "monorepo-test-cache" - ## disable sonarcloud until project set up - # - sonarcloud/scan + package: 'all' + monorepo_engine: 'turborepo' + cache_identifier: 'monorepo-test-cache' + - sonarcloud/scan e2e: executor: playwright @@ -65,6 +74,15 @@ jobs: command: yarn test:e2e - store_artifacts: path: packages/react-chat/test-results + - run: + name: Collect test reports + command: | + # copy all .report.xml files to the root directory + # and give them unique names based on their paths + mkdir -p reports + find . -type f -name "*.report.xml" | xargs -I {} sh -c 'cp {} reports/$(echo {} | cut -c 3- | tr "/" "_")' + - store_test_results: + path: './reports' push-to-cdn: # Main unit, style, and dependency tests executor: vfcommon/node-executor-node-20 @@ -87,13 +105,13 @@ workflows: avoid_post_install_scripts: false name: build package: all - monorepo_engine: "turborepo" + monorepo_engine: 'turborepo' force_execute: true run_in_container: false - container_folder_to_copy: "" #Copy all + container_folder_to_copy: '' #Copy all post_build_steps: - persist_to_workspace: - root: "." + root: '.' paths: - ./packages/*/dist # persist dist folder too @@ -115,8 +133,8 @@ workflows: avoid_post_install_scripts: false ssh_key: << pipeline.parameters.ssh-fingerprint >> context: dev-test - release_engine: "lite" - commit_message: "chore(release): publish --skip-ci" + release_engine: 'lite' + commit_message: 'chore(release): publish --skip-ci' requires: - test - e2e diff --git a/.depcheckrc b/.depcheckrc deleted file mode 100644 index 07debff24d..0000000000 --- a/.depcheckrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "specials": [ - "bin", - "babel", - "eslint", - "lint-staged", - "istanbul", - "commitizen", - "husky", - "prettier", - "ttypescript" - ], - "ignores": [ - "@commitlint/*", - "@storybook/*", - "@types/*", - "@voiceflow/commitlint-config", - "@voiceflow/eslint-config", - "@voiceflow/git-branch-check", - "@voiceflow/tsconfig", - "@svgr/webpack", - "@emotion/core", - "@vitest/coverage-c8", - "storybook-dark-mode", - "eslint-import-resolver-typescript", - "eslint-plugin-mdx", - "eslint-plugin-storybook", - "babel-loader", - "fixpack", - "husky", - "lint-staged", - "slate" - ] -} diff --git a/.editorconfig b/.editorconfig index 2b192c31c5..f5cf4fd526 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,30 +1,15 @@ +# EditorConfig: https://EditorConfig.org + +# top-most EditorConfig file root = true [*] -charset = utf-8 -end_of_line = lf -indent_size = 2 indent_style = space -insert_final_newline = true +indent_size = 2 +end_of_line = lf +charset = utf-8 trim_trailing_whitespace = true +insert_final_newline = true -[vcbuild.bat] -end_of_line = crlf - -[Makefile] -indent_size = 8 -indent_style = tab - -[{deps}/**] -charset = ignore -end_of_line = ignore -indent_size = ignore -indent_style = ignore -trim_trailing_whitespace = ignore - -[{test/fixtures,deps,tools/node_modules,tools/gyp,tools/icu,tools/msvs}/**] -insert_final_newline = false - -[*.js] +[*.json] trim_trailing_whitespace = false -max_line_length = 150 diff --git a/.gitignore b/.gitignore index 54203a3501..cda8b149d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,36 +1,46 @@ -.DS_Store -.idea +*.log +*.local +.cache + +# Node node_modules -dump.rdb -coverage -log/ +# output +build +dist +storybook-static +docs -.nyc_output +# Turborepo +.turbo + +# Dotenv +.env +.env.* +!.env.e2e +!.env.test + +# MacOS +.DS_Store + +# ESlint +.eslintcache # Yarn .pnp.* -.yarn/* +.yarn !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions -# build folders -build -dist - -# docs -docs - -#Sonar report -sonar/ -nyc_coverage* +# Tests +reports +*.report.xml -.turbo +# Coverage +sonar -.env.* - -build-storybook.log -storybook-static/ +#jetbrains +.idea diff --git a/.husky/commit-msg b/.husky/commit-msg index f2b8821905..ba6cc2399e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,3 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" yarn commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 5a182ef106..2de738c742 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,3 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" yarn lint-staged diff --git a/.husky/pre-push b/.husky/pre-push index 4eea212e06..f246eb0d30 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,3 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" yarn git-branch-check diff --git a/.lintstagedrc.js b/.lintstagedrc.js deleted file mode 100644 index 7bcb59a675..0000000000 --- a/.lintstagedrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - 'package.json': ['fixpack'], - '**/*.{js,ts}': ['eslint --fix'], -}; diff --git a/.prettierignore b/.prettierignore index e754fee7dc..92c6e233cc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,26 @@ -coverage -.idea -.nyc_output +CHANGELOG.md + +# Node +node_modules + +# output build dist -node_modules +storybook-static + +# Yarn +.pnp.* +.yarn +*.lock + +# Yalc +.yalc + +# Coverage +sonar + +# Tests +*.report.xml +# Playwright +test-results diff --git a/.releaserc b/.releaserc deleted file mode 100644 index 8b993a237f..0000000000 --- a/.releaserc +++ /dev/null @@ -1,5 +0,0 @@ -{ - branches: [ - master - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 1d37891e01..e078b516ce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,28 +1,48 @@ { - "editor.formatOnSave": true, - "eslint.format.enable": true, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "dbaeumer.vscode-eslint" + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "editor.codeActionsOnSave": { - "source.fixAll.tslint": "explicit", "source.fixAll.eslint": "explicit" }, - "eslint.runtime": "node", - "eslint.execArgv": ["--max_old_space_size=8192"], - "eslint.options": { - "extensions": [ - ".js", - ".jsx", - ".md", - ".mdx", - ".ts", - ".tsx" - ] - }, - "eslint.validate": [ - "markdown", - "mdx", - "javascript", - "javascriptreact", - "typescript", - "typescriptreact" - ] -} \ No newline at end of file + "eslint.format.enable": true, + "eslint.experimental.useFlatConfig": true, + "search.exclude": { + "**/node_modules": true, + "**/build": true, + "**/dist": true, + "**/test-results": true, + "**/playwright-report": true, + "**/sonar": true, + "**/.husky": true, + "**/.yarn": true, + "**/.turbo": true + } +} diff --git a/README.md b/README.md index 64bd134ceb..c579428bd9 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,13 @@ Ensure that the `verify: { projectID: ... }` field is replaced with your Voicefl s = d.getElementsByTagName(t)[0]; v.onload = function () { window.voiceflow.chat.load({ - verify: { projectID: "XXXXXX..." }, + verify: { projectID: 'XXXXXX...' }, }); }; - v.src = "https://cdn.voiceflow.com/widget/bundle.mjs"; - v.type = "text/javascript"; + v.src = 'https://cdn.voiceflow.com/widget/bundle.mjs'; + v.type = 'text/javascript'; s.parentNode.insertBefore(v, s); - })(document, "script"); + })(document, 'script'); ``` diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 5d959343bf..0000000000 --- a/commitlint.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ['@voiceflow/commitlint-config'], -}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..905ecf62b1 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,14 @@ +import baseConfig from '@voiceflow/eslint-config'; + +/** @type {import('eslint').Linter.FlatConfig[]} */ +export default [ + ...baseConfig, + { + ignores: ['**/storybook-static/**'], + }, + { + rules: { + 'no-console': ['error', { allow: ['info', 'warn', 'error'] }], + }, + }, +]; diff --git a/examples/live-agent/.eslintrc.js b/examples/live-agent/.eslintrc.js deleted file mode 100644 index 11038fe19c..0000000000 --- a/examples/live-agent/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['@voiceflow/eslint-config', '@voiceflow/eslint-config/frontend', '@voiceflow/eslint-config/typescript'], - rules: { - 'react/react-in-jsx-scope': 'off', - 'no-console': 'off', - }, -}; diff --git a/examples/live-agent/index.html b/examples/live-agent/index.html index 43d8cdae59..40d35f4e21 100644 --- a/examples/live-agent/index.html +++ b/examples/live-agent/index.html @@ -1,16 +1,14 @@ - + +
+ + + +