From 67d94954818234322cbf78a0888b09453ad3973d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 22 Sep 2022 14:59:28 +0100 Subject: [PATCH] Some updates, typescripting some more APIs, as well as fixing a lot of Router creation which did not specify the 'new' operator. --- packages/bbui/README.md | 2 +- packages/bbui/rollup.config.js | 2 +- packages/builder/cypress/plugins/index.js | 2 +- packages/builder/cypress/support/index.js | 2 +- packages/client/README.md | 2 +- packages/client/rollup.config.js | 2 +- .../DevToolsComponentContextTab.svelte | 2 +- .../DevToolsComponentSettingsTab.svelte | 2 +- packages/server/pm2.config.js | 2 +- .../src/api/controllers/{auth.js => auth.ts} | 21 ++++++----- packages/server/src/api/routes/analytics.js | 2 +- packages/server/src/api/routes/apikeys.js | 2 +- packages/server/src/api/routes/auth.js | 8 ----- packages/server/src/api/routes/auth.ts | 8 +++++ packages/server/src/api/routes/automation.js | 2 +- packages/server/src/api/routes/backup.js | 2 +- packages/server/src/api/routes/cloud.js | 2 +- packages/server/src/api/routes/component.js | 2 +- packages/server/src/api/routes/datasource.js | 2 +- packages/server/src/api/routes/deploy.js | 2 +- packages/server/src/api/routes/dev.js | 2 +- packages/server/src/api/routes/integration.js | 2 +- packages/server/src/api/routes/layout.js | 2 +- packages/server/src/api/routes/metadata.js | 2 +- packages/server/src/api/routes/migrations.js | 2 +- packages/server/src/api/routes/permission.js | 2 +- packages/server/src/api/routes/query.js | 2 +- packages/server/src/api/routes/role.js | 2 +- packages/server/src/api/routes/routing.js | 2 +- packages/server/src/api/routes/screen.js | 2 +- packages/server/src/api/routes/script.js | 2 +- packages/server/src/api/routes/table.js | 2 +- packages/server/src/api/routes/templates.js | 2 +- packages/server/src/api/routes/user.js | 2 +- packages/server/src/api/routes/view.js | 2 +- packages/server/src/api/routes/webhook.js | 2 +- packages/worker/pm2.config.js | 2 +- .../worker/src/api/controllers/global/self.ts | 8 ++--- .../global/{templates.js => templates.ts} | 36 ++++++++++--------- packages/worker/src/api/routes/global/auth.js | 2 +- .../worker/src/api/routes/global/configs.js | 2 +- .../worker/src/api/routes/global/email.js | 2 +- .../worker/src/api/routes/global/roles.js | 2 +- packages/worker/src/api/routes/global/self.ts | 16 ++++----- .../global/{templates.js => templates.ts} | 6 ++-- .../worker/src/api/routes/global/users.js | 2 +- .../src/api/routes/global/workspaces.js | 2 +- packages/worker/src/api/routes/index.js | 34 ------------------ packages/worker/src/api/routes/index.ts | 34 ++++++++++++++++++ .../src/api/routes/system/environment.js | 2 +- .../worker/src/api/routes/system/status.js | 2 +- .../worker/src/api/routes/system/tenants.js | 2 +- 52 files changed, 129 insertions(+), 128 deletions(-) rename packages/server/src/api/controllers/{auth.js => auth.ts} (73%) delete mode 100644 packages/server/src/api/routes/auth.js create mode 100644 packages/server/src/api/routes/auth.ts rename packages/worker/src/api/controllers/global/{templates.js => templates.ts} (59%) rename packages/worker/src/api/routes/global/{templates.js => templates.ts} (91%) delete mode 100644 packages/worker/src/api/routes/index.js create mode 100644 packages/worker/src/api/routes/index.ts diff --git a/packages/bbui/README.md b/packages/bbui/README.md index 9b71a86cab..3920626d99 100644 --- a/packages/bbui/README.md +++ b/packages/bbui/README.md @@ -15,7 +15,7 @@ A package that handles all common components across the Budibase organisation. Y 1. Create a file: `Headline.svelte` 2. Create a Svench file: `Headline.svench` 3. Build component and add variants to the Svench file. -4. Once done, re-export the file in `src/index.js`. +4. Once done, re-export the file in `src/index.ts`. 5. Publish, update the package in the main project and profit. ## Guidelines diff --git a/packages/bbui/rollup.config.js b/packages/bbui/rollup.config.js index e285d548d6..1645339014 100644 --- a/packages/bbui/rollup.config.js +++ b/packages/bbui/rollup.config.js @@ -6,7 +6,7 @@ import { terser } from "rollup-plugin-terser" import postcss from "rollup-plugin-postcss" export default { - input: "src/index.js", + input: "src/index.ts", output: { sourcemap: true, format: "esm", diff --git a/packages/builder/cypress/plugins/index.js b/packages/builder/cypress/plugins/index.js index 771ba886b5..0b38f6351a 100644 --- a/packages/builder/cypress/plugins/index.js +++ b/packages/builder/cypress/plugins/index.js @@ -1,6 +1,6 @@ /// // *********************************************************** -// This example plugins/index.js can be used to load plugins +// This example plugins/index.ts can be used to load plugins // // You can change the location of this file or turn off loading // the plugins file with the 'pluginsFile' configuration option. diff --git a/packages/builder/cypress/support/index.js b/packages/builder/cypress/support/index.js index acd53a1592..c916520a30 100644 --- a/packages/builder/cypress/support/index.js +++ b/packages/builder/cypress/support/index.js @@ -1,5 +1,5 @@ // *********************************************************** -// This example support/index.js is processed and +// This example support/index.ts is processed and // loaded automatically before your test files. // // This is a great place to put global configuration and diff --git a/packages/client/README.md b/packages/client/README.md index 335dcbd3e6..5c9ba977cd 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -8,7 +8,7 @@ their settings, and know how to correctly interact with them. ### Component Definitions -The object key is the name of the component, as exported by `index.js`. +The object key is the name of the component, as exported by `index.ts`. - **name** - the name displayed in the builder - **description** - not currently used diff --git a/packages/client/rollup.config.js b/packages/client/rollup.config.js index 5206b63884..98bcfb77f0 100644 --- a/packages/client/rollup.config.js +++ b/packages/client/rollup.config.js @@ -19,7 +19,7 @@ const ignoredWarnings = [ ] export default { - input: "src/index.js", + input: "src/index.ts", output: [ { sourcemap: false, diff --git a/packages/client/src/components/devtools/DevToolsComponentContextTab.svelte b/packages/client/src/components/devtools/DevToolsComponentContextTab.svelte index 3b4c426851..6e020c06f4 100644 --- a/packages/client/src/components/devtools/DevToolsComponentContextTab.svelte +++ b/packages/client/src/components/devtools/DevToolsComponentContextTab.svelte @@ -1,6 +1,6 @@