From 0c1b91ab2fe44612691f09e8525a8020af89afa1 Mon Sep 17 00:00:00 2001 From: lana-k Date: Thu, 20 Mar 2025 22:04:15 +0100 Subject: [PATCH] format --- .eslintrc.js | 12 +- .github/workflows/config.grenrc.js | 13 +- .github/workflows/main.yml | 60 +- .github/workflows/test.yml | 40 +- .prettierrc | 7 + README.md | 7 +- babel.config.js | 4 +- index.html | 44 +- jsconfig.json | 10 + karma.conf.cjs | 8 +- lib/sql-js/README.md | 20 +- lib/sql-js/benchmark/karma.conf.js | 17 +- lib/sql-js/benchmark/package.json | 4 +- lib/sql-js/benchmark/suite.js | 31 +- package-lock.json | 58 +- package.json | 5 +- public/inquiries.json | 2 +- public/manifest.webmanifest | 2 +- src/App.vue | 36 +- src/assets/styles/buttons.css | 2 - src/assets/styles/messages.css | 2 +- src/assets/styles/multiselect.css | 4 +- src/assets/styles/scrollbars.css | 6 +- src/assets/styles/tables.css | 11 +- src/assets/styles/tooltips.css | 4 +- src/assets/styles/variables.css | 31 +- src/components/CheckBox.vue | 16 +- .../CsvJsonImport/DelimiterSelector/index.vue | 23 +- src/components/CsvJsonImport/index.vue | 94 +-- src/components/DbUploader.vue | 62 +- src/components/IconButton.vue | 13 +- src/components/LoadingDialog.vue | 17 +- src/components/LoadingIndicator.vue | 43 +- src/components/Logs.vue | 23 +- src/components/Splitpanes/index.vue | 123 ++-- src/components/Splitpanes/splitter.js | 35 +- src/components/SqlTable/Pager.vue | 8 +- src/components/SqlTable/index.vue | 125 ++-- src/components/TextField.vue | 14 +- src/components/svg/addTable.vue | 4 +- src/components/svg/arrow.vue | 5 +- src/components/svg/changeDb.vue | 42 +- src/components/svg/chart.vue | 8 +- src/components/svg/clear.vue | 5 +- src/components/svg/clipboard.vue | 8 +- src/components/svg/close.vue | 2 +- src/components/svg/dataView.vue | 12 +- src/components/svg/dropDownChevron.vue | 5 +- src/components/svg/edgeArrow.vue | 3 +- src/components/svg/export.vue | 2 +- src/components/svg/exportToCsv.vue | 10 +- src/components/svg/exportToSvg.vue | 8 +- src/components/svg/hint.vue | 8 +- src/components/svg/html.vue | 4 +- src/components/svg/pivot.vue | 14 +- src/components/svg/png.vue | 12 +- src/components/svg/row.vue | 32 +- src/components/svg/run.vue | 13 +- src/components/svg/sort.vue | 1 - src/components/svg/sqlEditor.vue | 15 +- src/components/svg/table.vue | 8 +- src/components/svg/treeChevron.vue | 5 +- src/components/svg/viewCellValue.vue | 52 +- src/lib/chartHelper.js | 10 +- src/lib/csv.js | 12 +- src/lib/database/_sql.js | 34 +- src/lib/database/_statements.js | 13 +- src/lib/database/_worker.js | 8 +- src/lib/database/index.js | 52 +- src/lib/storedInquiries/_migrations.js | 2 +- src/lib/storedInquiries/index.js | 44 +- src/lib/tab.js | 15 +- src/lib/utils/clipboardIo.js | 25 +- src/lib/utils/events.js | 2 +- src/lib/utils/fileIo.js | 29 +- src/lib/utils/time.js | 10 +- src/registerServiceWorker.js | 5 +- src/store/actions.js | 19 +- src/store/mutations.js | 48 +- src/tooltipMixin.js | 15 +- src/views/LoadView.vue | 41 +- src/views/Main/AppDiagnosticInfo.vue | 20 +- src/views/Main/Inquiries/index.vue | 348 ++++++----- src/views/Main/Inquiries/svg/copy.vue | 2 +- src/views/Main/Inquiries/svg/delete.vue | 2 +- src/views/Main/Inquiries/svg/rename.vue | 2 +- src/views/Main/MainMenu.vue | 47 +- .../Workspace/Schema/TableDescription.vue | 7 +- src/views/Main/Workspace/Schema/index.vue | 26 +- .../Tabs/Tab/DataView/Chart/index.vue | 72 ++- .../DataView/Pivot/PivotUi/PivotSortBtn.vue | 16 +- .../Tabs/Tab/DataView/Pivot/PivotUi/index.vue | 64 +- .../Tabs/Tab/DataView/Pivot/index.vue | 93 +-- .../Tabs/Tab/DataView/Pivot/pivotHelper.js | 20 +- .../Workspace/Tabs/Tab/DataView/index.vue | 52 +- .../Tab/RunResult/Record/RowNavigator.vue | 78 +-- .../Tabs/Tab/RunResult/Record/index.vue | 57 +- .../Tabs/Tab/RunResult/ValueViewer.vue | 50 +- .../Workspace/Tabs/Tab/RunResult/index.vue | 165 +++--- .../Main/Workspace/Tabs/Tab/SideToolBar.vue | 6 +- .../Main/Workspace/Tabs/Tab/SqlEditor/hint.js | 18 +- .../Workspace/Tabs/Tab/SqlEditor/index.vue | 12 +- src/views/Main/Workspace/Tabs/Tab/index.vue | 30 +- src/views/Main/Workspace/Tabs/index.vue | 63 +- src/views/Main/Workspace/index.vue | 15 +- src/views/Main/index.vue | 10 +- test.setup.js | 12 +- tests/App.spec.js | 15 +- tests/components/CheckBox.spec.js | 10 +- tests/components/CsvImport/CsvImport.spec.js | 545 ++++++++++++------ .../CsvImport/DelimiterSelector.spec.js | 12 +- tests/components/DbUploader.spec.js | 1 - tests/components/LoadingIndicator.spec.js | 5 +- tests/components/Logs.spec.js | 10 +- .../components/Splitpanes/Splitpanes.spec.js | 168 ++++-- tests/components/Splitpanes/splitter.spec.js | 12 +- tests/components/SqlTable/Pager.spec.js | 2 +- tests/lib/chartHelper.spec.js | 5 +- tests/lib/database/_sql.spec.js | 4 +- tests/lib/database/_statements.spec.js | 5 +- tests/lib/database/database.spec.js | 82 ++- tests/lib/database/sqliteExtensions.spec.js | 21 +- .../storedInquiries/storedInquiries.spec.js | 100 ++-- tests/lib/tab.spec.js | 8 +- tests/lib/utils/fileIo.spec.js | 16 +- tests/store/actions.spec.js | 76 ++- tests/store/mutations.spec.js | 34 +- tests/tooltipMixin.spec.js | 65 ++- tests/views/LoadView.spec.js | 16 +- tests/views/Main/Inquiries/Inquiries.spec.js | 449 +++++++++------ tests/views/Main/MainMenu.spec.js | 518 +++++++++-------- .../Main/Workspace/Schema/Schema.spec.js | 24 +- .../Workspace/Schema/TableDescription.spec.js | 8 +- .../Tabs/Tab/DataView/DataView.spec.js | 69 ++- .../Tabs/Tab/DataView/Pivot/Pivot.spec.js | 49 +- .../Pivot/PivotUi/PivotSortBtn.spec.js | 4 +- .../DataView/Pivot/PivotUi/PivotUi.spec.js | 19 +- .../Tab/DataView/Pivot/pivotHelper.spec.js | 19 +- .../Tabs/Tab/RunResult/Record.spec.js | 40 +- .../Tabs/Tab/RunResult/RunResult.spec.js | 37 +- .../Tabs/Tab/RunResult/ValueViewer.spec.js | 7 +- .../Tabs/Tab/SqlEditor/SqlEditor.spec.js | 18 +- .../Workspace/Tabs/Tab/SqlEditor/hint.spec.js | 87 ++- .../views/Main/Workspace/Tabs/Tab/Tab.spec.js | 109 ++-- tests/views/Main/Workspace/Tabs/Tabs.spec.js | 74 ++- vite.config.js | 27 +- 146 files changed, 3317 insertions(+), 2438 deletions(-) create mode 100644 .prettierrc create mode 100644 jsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index 3853d47..d5d36c3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,12 +2,9 @@ module.exports = { root: true, env: { node: true, - es2022: true, + es2022: true }, - extends: [ - 'plugin:vue/essential', - '@vue/standard' - ], + extends: ['eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'], rules: { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', @@ -20,10 +17,7 @@ module.exports = { }, overrides: [ { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/**/*.spec.{j,t}s?(x)' - ], + files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/**/*.spec.{j,t}s?(x)'], env: { mocha: true } diff --git a/.github/workflows/config.grenrc.js b/.github/workflows/config.grenrc.js index e9b0b1b..6ffbed8 100644 --- a/.github/workflows/config.grenrc.js +++ b/.github/workflows/config.grenrc.js @@ -1,17 +1,14 @@ module.exports = { dataSource: 'milestones', - ignoreIssuesWith: [ - 'wontfix', - 'duplicate' - ], + ignoreIssuesWith: ['wontfix', 'duplicate'], milestoneMatch: 'v{{tag_name}}', template: { issue: '- {{name}} [{{text}}]({{url}})', - changelogTitle: "", - release: "{{body}}", + changelogTitle: '', + release: '{{body}}' }, groupBy: { - 'Enhancements': ["enhancement", "internal"], - 'Bug fixes': ["bug"] + Enhancements: ['enhancement', 'internal'], + 'Bug fixes': ['bug'] } } diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99765c6..3a20e2c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,43 +3,43 @@ on: workflow_dispatch: push: tags: - - '*' + - '*' jobs: deploy: name: Create release - runs-on: ubuntu-latest + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 16.x + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 16.x - - name: Update npm - run: npm install -g npm@8 + - name: Update npm + run: npm install -g npm@8 - - name: npm install and build - run: | - npm install - npm run build + - name: npm install and build + run: | + npm install + npm run build - - name: Create archives - run: | - cd dist - zip -9 -r ../dist.zip . -x "js/*.map" -x "/*.map" - zip -9 -r ../dist_map.zip . + - name: Create archives + run: | + cd dist + zip -9 -r ../dist.zip . -x "js/*.map" -x "/*.map" + zip -9 -r ../dist_map.zip . - - name: Create Release Notes - run: | - npm install github-release-notes@0.16.0 -g - gren changelog --generate --config="/.github/workflows/config.grenrc.js" - env: - GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release Notes + run: | + npm install github-release-notes@0.16.0 -g + gren changelog --generate --config="/.github/workflows/config.grenrc.js" + env: + GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create release - uses: ncipollo/release-action@v1 - with: - artifacts: "dist.zip,dist_map.zip" - token: ${{ secrets.GITHUB_TOKEN }} - bodyFile: "CHANGELOG.md" + - name: Create release + uses: ncipollo/release-action@v1 + with: + artifacts: 'dist.zip,dist_map.zip' + token: ${{ secrets.GITHUB_TOKEN }} + bodyFile: 'CHANGELOG.md' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db70d6d..fff4da9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,35 +3,35 @@ on: workflow_dispatch: push: branches: - - 'master' + - 'master' pull_request: branches: - - 'master' + - 'master' jobs: test: name: Run tests runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 16.x - - name: Install browsers - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y chromium-browser firefox + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Install browsers + run: | + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update + sudo apt-get install -y chromium-browser firefox - - name: Update npm - run: npm install -g npm@8 + - name: Update npm + run: npm install -g npm@8 - - name: Install the project - run: npm install + - name: Install the project + run: npm install - - name: Run lint - run: npm run lint -- --no-fix + - name: Run lint + run: npm run lint -- --no-fix - - name: Run karma tests - run: npm run test + - name: Run karma tests + run: npm run test diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..a998616 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "none", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "arrowParens": "avoid" +} diff --git a/README.md b/README.md index 59a80a9..8945074 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,10 @@ # sqliteviz Sqliteviz is a single-page offline-first PWA for fully client-side visualisation - of SQLite databases, CSV, JSON or NDJSON files. +of SQLite databases, CSV, JSON or NDJSON files. With sqliteviz you can: + - run SQL queries against a SQLite database and create [Plotly][11] charts and pivot tables based on the result sets - import a CSV/JSON/NDJSON file into a SQLite database and visualize imported data - export result set to CSV file @@ -19,15 +20,19 @@ With sqliteviz you can: https://user-images.githubusercontent.com/24638357/128249848-f8fab0f5-9add-46e0-a9c1-dd5085a8623e.mp4 ## Quickstart + The latest release of sqliteviz is deployed on [sqliteviz.com/app][6]. ## Wiki + For user documentation, check out sqliteviz [documentation][7]. ## Motivation + It's a kind of middleground between [Plotly Falcon][1] and [Redash][2]. ## Components + It is built on top of [react-chart-editor][3], [PivotTable.js][12], [sql.js][4] and [Vue-Codemirror][8] in [Vue.js][5]. CSV parsing is performed with [Papa Parse][9]. [1]: https://github.com/plotly/falcon diff --git a/babel.config.js b/babel.config.js index e955840..716b023 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,3 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] + presets: ['@vue/cli-plugin-babel/preset'] } diff --git a/index.html b/index.html index e47af9d..4d2772a 100644 --- a/index.html +++ b/index.html @@ -1,11 +1,11 @@ - + - - - - - + + + + + sqliteviz diff --git a/src/components/CsvJsonImport/DelimiterSelector/index.vue b/src/components/CsvJsonImport/DelimiterSelector/index.vue index 41ea611..84db0f6 100644 --- a/src/components/CsvJsonImport/DelimiterSelector/index.vue +++ b/src/components/CsvJsonImport/DelimiterSelector/index.vue @@ -1,5 +1,5 @@