diff --git a/.eslintrc.json b/.eslintrc.json index d94c749042..75584b8163 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,7 @@ "jest": true, "node": true }, - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 2019, "sourceType": "module", @@ -18,17 +18,23 @@ "*.spec.js", "bundle.js" ], - "plugins": ["svelte3"], "extends": ["eslint:recommended"], "overrides": [ { - "files": ["*.svelte"], - "processor": "svelte3/svelte3" + "files": ["**/*.svelte"], + "extends": "plugin:svelte/recommended", + "parser": "svelte-eslint-parser", + "parserOptions": { + "parser": "@babel/eslint-parser", + "ecmaVersion": 2019, + "sourceType": "module", + "allowImportExportEverywhere": true + } + }, { "files": ["**/*.ts"], "parser": "@typescript-eslint/parser", - "plugins": [], "extends": ["eslint:recommended"], "rules": { "no-unused-vars": "off", @@ -41,7 +47,8 @@ } ], "rules": { - "no-self-assign": "off" + "no-self-assign": "off", + "no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }] }, "globals": { "GeolocationPositionError": true diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 68625ad7af..9a86f50c04 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -34,7 +34,6 @@ jobs: exit 1 fi - - uses: actions/setup-node@v1 with: node-version: 14.x @@ -58,9 +57,12 @@ jobs: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release - - name: "Get Previous tag" - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" + - name: "Get Current tag" + id: currenttag + run: | + version=v$(./scripts/getCurrentVersion.sh) + echo 'Using tag $version' + echo "::set-output name=tag::$resversionult" - name: Build/release Docker images run: | @@ -69,7 +71,7 @@ jobs: env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} - BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} + BUDIBASE_RELEASE_VERSION: ${{ steps.currenttag.outputs.tag }} release-helm-chart: needs: [release-images] diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000000..a6c42326bb --- /dev/null +++ b/babel.config.json @@ -0,0 +1,3 @@ +{ + "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] +} diff --git a/lerna.json b/lerna.json index d7fd7682b3..5c20645fec 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.2-alpha.1", + "version": "2.8.2-alpha.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index 42e528dfce..a4b830d40b 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,10 @@ "@nx/js": "16.2.1", "@rollup/plugin-json": "^4.0.2", "@typescript-eslint/parser": "5.45.0", - "babel-eslint": "^10.0.3", "esbuild": "^0.17.18", "esbuild-node-externals": "^1.7.0", - "eslint": "^7.28.0", + "eslint": "^8.44.0", "eslint-plugin-cypress": "^2.11.3", - "eslint-plugin-svelte3": "^3.2.0", "husky": "^8.0.3", "js-yaml": "^4.1.0", "kill-port": "^1.6.1", @@ -23,7 +21,12 @@ "rimraf": "^3.0.2", "rollup-plugin-replace": "^2.2.0", "svelte": "^3.38.2", - "typescript": "4.7.3" + "typescript": "4.7.3", + "@babel/core": "^7.22.5", + "@babel/eslint-parser": "^7.22.5", + "@babel/preset-env": "^7.22.5", + "eslint-plugin-svelte": "^2.32.2", + "svelte-eslint-parser": "^0.32.0" }, "scripts": { "preinstall": "node scripts/syncProPackage.js", @@ -52,10 +55,10 @@ "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream --parallel dev:built", "dev:docker": "yarn build:docker:pre && docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0", "test": "lerna run --stream test --stream", - "lint:eslint": "eslint packages && eslint qa-core", + "lint:eslint": "eslint packages qa-core --max-warnings=0", "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --check \"qa-core/**/*.{js,ts,svelte}\"", "lint": "yarn run lint:eslint && yarn run lint:prettier", - "lint:fix:eslint": "eslint --fix packages qa-core", + "lint:fix:eslint": "eslint --fix --max-warnings=0 packages qa-core", "lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --write \"qa-core/**/*.{js,ts,svelte}\"", "lint:fix": "yarn run lint:fix:prettier && yarn run lint:fix:eslint", "build:specs": "lerna run --stream specs", @@ -103,5 +106,6 @@ "@budibase/string-templates": "0.0.0", "@budibase/types": "0.0.0" }, - "dependencies": {} + "dependencies": { + } } diff --git a/packages/bbui/src/FancyForm/FancyButtonRadio.svelte b/packages/bbui/src/FancyForm/FancyButtonRadio.svelte index 510fd8efb8..3048b09555 100644 --- a/packages/bbui/src/FancyForm/FancyButtonRadio.svelte +++ b/packages/bbui/src/FancyForm/FancyButtonRadio.svelte @@ -15,8 +15,6 @@ const dispatch = createEventDispatcher() - $: placeholder = !value - const extractProperty = (value, property) => { if (value && typeof value === "object") { return value[property] diff --git a/packages/bbui/src/Form/Core/EnvDropdown.svelte b/packages/bbui/src/Form/Core/EnvDropdown.svelte index 0c647a1911..2edf8a5f9d 100644 --- a/packages/bbui/src/Form/Core/EnvDropdown.svelte +++ b/packages/bbui/src/Form/Core/EnvDropdown.svelte @@ -150,7 +150,7 @@ {:else if variables.length}
- {#each variables as variable, idx} + {#each variables as variable}
  • { + if (type === "bigint") { + return "numeric" + } + return type === "number" ? "decimal" : "text" + } + onMount(() => { focus = autofocus if (focus) field.focus() @@ -103,7 +110,7 @@ {type} class="spectrum-Textfield-input" style={align ? `text-align: ${align};` : ""} - inputmode={type === "number" ? "decimal" : "text"} + inputmode={getInputMode(type)} {autocomplete} />
  • diff --git a/packages/bbui/src/Table/CellRenderer.svelte b/packages/bbui/src/Table/CellRenderer.svelte index 5004401d91..c64b975884 100644 --- a/packages/bbui/src/Table/CellRenderer.svelte +++ b/packages/bbui/src/Table/CellRenderer.svelte @@ -29,7 +29,6 @@ $: type = getType(schema) $: customRenderer = customRenderers?.find(x => x.column === schema?.name) $: renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer - $: width = schema?.width || "150px" $: cellValue = getCellValue(value, schema.template) const getType = schema => { diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index f8528aac36..3a86295178 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -379,7 +379,7 @@ {/if} {#if sortedRows?.length} - {#each sortedRows as row, idx} + {#each sortedRows as row}
    {#if showEditColumn}
    { }) export const isOnlyUser = derived(userStore, $userStore => { - return $userStore.length === 1 + return $userStore.length < 2 }) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 1a45a7980a..f312a58e97 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -1333,7 +1333,7 @@ export const getFrontendStore = () => { links: { save: async (url, title) => { const navigation = get(store).navigation - let links = [...navigation?.links] + let links = [...(navigation?.links ?? [])] // Skip if we have an identical link if (links.find(link => link.url === url && link.text === title)) { diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js index 6fdedbe44c..ace5196bba 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js +++ b/packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js @@ -4,6 +4,7 @@ import { getSchemaForDatasource } from "../../../dataBinding" const fieldTypeToComponentMap = { string: "stringfield", number: "numberfield", + bigint: "bigintfield", options: "optionsfield", array: "multifieldselect", boolean: "booleanfield", diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte index 96dc8f4686..15dd864168 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte @@ -168,7 +168,7 @@ Plugins
    - {#each Object.entries(plugins) as [idx, action]} + {#each Object.entries(plugins) as [_, action]}
    + {@html html}
    diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index 5fb27eaaf3..647a8081cf 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -71,7 +71,7 @@
    - {#each triggers as [idx, trigger]} + {#each triggers as [_, trigger]}
    { Object.values(schema || {}).forEach(col => { diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 665175a435..208739a540 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -57,7 +57,6 @@ let table = $tables.selected let confirmDeleteDialog - let deletion let savingColumn let deleteColName let jsonSchemaModal @@ -215,7 +214,6 @@ notifications.success(`Column ${editableColumn.name} deleted`) confirmDeleteDialog.hide() hide() - deletion = false dispatch("updatecolumns") } } catch (error) { @@ -266,13 +264,11 @@ function confirmDelete() { confirmDeleteDialog.show() - deletion = true } function hideDeleteDialog() { confirmDeleteDialog.hide() deleteColName = "" - deletion = false } function getRelationshipOptions(field) { @@ -330,6 +326,7 @@ FIELDS.NUMBER, FIELDS.BOOLEAN, FIELDS.FORMULA, + FIELDS.BIGINT, ] // no-sql or a spreadsheet if (!external || table.sql) { diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 99d7d5285d..f7b6f61a10 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -169,7 +169,7 @@ on:click={() => selectTable(TableNames.USERS)} selectedBy={$userSelectedResourceMap[TableNames.USERS]} /> - {#each enrichedDataSources as datasource, idx} + {#each enrichedDataSources as datasource} @@ -102,24 +102,24 @@ diff --git a/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte index eba17e8ab9..6ea2d771e9 100644 --- a/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/ExistingTableDataImport.svelte @@ -6,7 +6,6 @@ let error = null let fileName = null - let fileType = null let loading = false let updateExistingRows = false @@ -74,7 +73,6 @@ const response = await parseFile(e) rows = response.rows fileName = response.fileName - fileType = response.fileType } catch (e) { loading = false error = e diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index f34a3e9c98..40af470b4d 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -7,7 +7,6 @@ let fileInput let error = null let fileName = null - let fileType = null let loading = false let validation = {} @@ -60,7 +59,6 @@ rows = response.rows schema = response.schema fileName = response.fileName - fileType = response.fileType } catch (e) { loading = false error = e diff --git a/packages/builder/src/components/commandPalette/CommandPalette.svelte b/packages/builder/src/components/commandPalette/CommandPalette.svelte index f77736055e..3c95dbbd0b 100644 --- a/packages/builder/src/components/commandPalette/CommandPalette.svelte +++ b/packages/builder/src/components/commandPalette/CommandPalette.svelte @@ -93,42 +93,42 @@ `https://github.com/Budibase/budibase/issues/new?assignees=&labels=bug&template=bug_report.md&title=` ), }, - ...$datasources?.list.map(datasource => ({ + ...($datasources?.list?.map(datasource => ({ type: "Datasource", name: `${datasource.name}`, icon: "Data", action: () => $goto(`./data/datasource/${datasource._id}`), - })), - ...$tables?.list.map(table => ({ + })) ?? []), + ...($tables?.list?.map(table => ({ type: "Table", name: table.name, icon: "Table", action: () => $goto(`./data/table/${table._id}`), - })), - ...$views?.list.map(view => ({ + })) ?? []), + ...($views?.list?.map(view => ({ type: "View", name: view.name, icon: "Remove", action: () => $goto(`./data/view/${view.name}`), - })), - ...$queries?.list.map(query => ({ + })) ?? []), + ...($queries?.list?.map(query => ({ type: "Query", name: query.name, icon: "SQLQuery", action: () => $goto(`./data/query/${query._id}`), - })), + })) ?? []), ...$sortedScreens.map(screen => ({ type: "Screen", name: screen.routing.route, icon: "WebPage", action: () => $goto(`./design/${screen._id}/components`), })), - ...$automationStore?.automations.map(automation => ({ + ...($automationStore?.automations?.map(automation => ({ type: "Automation", name: automation.name, icon: "ShareAndroid", action: () => $goto(`./automation/${automation._id}`), - })), + })) ?? []), ...Constants.Themes.map(theme => ({ type: "Change Builder Theme", name: theme.name, @@ -237,11 +237,11 @@
    - {#each categories as [name, results], catIdx} + {#each categories as [name, results]}
    {name}
    - {#each results as command, cmdIdx} + {#each results as command}
    runAction(command)} diff --git a/packages/builder/src/components/common/CustomSVG.svelte b/packages/builder/src/components/common/CustomSVG.svelte index ce6e964c38..3cd73a8d7a 100644 --- a/packages/builder/src/components/common/CustomSVG.svelte +++ b/packages/builder/src/components/common/CustomSVG.svelte @@ -20,4 +20,5 @@ } + {@html substituteSize(svgHtml)} diff --git a/packages/builder/src/components/common/bindings/BindingPicker.svelte b/packages/builder/src/components/common/bindings/BindingPicker.svelte index 50e7c66682..f752e37315 100644 --- a/packages/builder/src/components/common/bindings/BindingPicker.svelte +++ b/packages/builder/src/components/common/bindings/BindingPicker.svelte @@ -88,6 +88,7 @@ {/if} {#if hoverTarget.description}
    + {@html hoverTarget.description}
    {/if} @@ -124,7 +125,6 @@ /> - { @@ -162,7 +162,6 @@