x.id.includes(blankScreen))}
- on:click={() =>
- toggleScreenSelection(templates.find(t => t.id === blankScreen))}
- class:disabled={autoSelected}
+ class="screen-type item"
+ class:selected={selectedScreenMode == blankScreenModeKey}
+ on:click={() => {
+ selectedScreenMode = blankScreenModeKey
+ }}
>
-
-
Blank
+
+
+
+ Blank screen
+ Add a blank screen
+
- {#if selectedScreens.find(x => x.id === blankScreen)}
+ {#if selectedScreenMode == blankScreenModeKey}
-
+
{/if}
- {#if $tables.list.filter(table => table._id !== "ta_users").length > 0}
-
Autogenerated Screens
- {#each $tables.list.filter(table => table._id !== "ta_users") as table}
-
x.table === table.name)}
- on:click={() => toggleScreenSelection(table)}
- class="item"
- >
-
-
- {#if selectedScreens.find(x => x.table === table.name)}
-
-
-
- {/if}
-
+
{
+ selectedScreenMode = autoCreateModeKey
+ }}
+ class:disabled={!$tables.list.filter(table => table._id !== "ta_users")
+ .length}
+ >
+
+
+
+ Autogenerated screens
+
+ Add autogenerated screens with CRUD functionality to get a working
+ app quickly! (Requires a data source)
+
- {/each}
- {/if}
+
+
+ {#if selectedScreenMode == autoCreateModeKey}
+
+
+
+ {/if}
+
+
-
- {#if showProgressCircle}
-
- {/if}
-
diff --git a/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte b/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte
index 75977e51a2..4afd182053 100644
--- a/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte
+++ b/packages/builder/src/components/design/NavigationPanel/ScreenDetailsModal.svelte
@@ -1,18 +1,23 @@
-
+
+
+
+
+ newScreenModal.show()}
+ initalScreens={!selectedTemplates ? [] : [...selectedTemplates]}
+ />
+
+
+
+
+ Select which level of access you want your screens to have
+
newScreenModal.show()}
+ initialUrl={blankScreenUrl}
/>
diff --git a/packages/builder/src/components/integration/QueryViewer.svelte b/packages/builder/src/components/integration/QueryViewer.svelte
index 19c1165d9e..8f6f9eeb53 100644
--- a/packages/builder/src/components/integration/QueryViewer.svelte
+++ b/packages/builder/src/components/integration/QueryViewer.svelte
@@ -72,7 +72,7 @@
fields = response.schema
notifications.success("Query executed successfully")
} catch (error) {
- notifications.error("Error previewing query")
+ notifications.error(`Query Error: ${error.message}`)
}
}
diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js
index 9a623241ca..2f5f26e476 100644
--- a/packages/builder/src/constants/backend/index.js
+++ b/packages/builder/src/constants/backend/index.js
@@ -179,6 +179,7 @@ export const IntegrationTypes = {
INTERNAL: "INTERNAL",
GOOGLE_SHEETS: "GOOGLE_SHEETS",
FIREBASE: "FIREBASE",
+ REDIS: "REDIS",
}
export const IntegrationNames = {
@@ -197,6 +198,7 @@ export const IntegrationNames = {
[IntegrationTypes.INTERNAL]: "Internal",
[IntegrationTypes.GOOGLE_SHEETS]: "Google Sheets",
[IntegrationTypes.FIREBASE]: "Firebase",
+ [IntegrationTypes.REDIS]: "Redis",
}
export const SchemaTypeOptions = [
diff --git a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte
index b001f02fe9..242b21d945 100644
--- a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte
@@ -160,6 +160,10 @@
}
docs.forEach(element => {
+ // Delete unsupported fields
+ delete element.createdAt
+ delete element.updatedAt
+
if (element.type === ConfigTypes.OIDC) {
// Add a UUID here so each config is distinguishable when it arrives at the login page
for (let config of element.config.configs) {
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 03b27b289b..7aa34fecf1 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
diff --git a/packages/client/package.json b/packages/client/package.json
index c25cc0932f..149e80b367 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/client",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
- "@budibase/bbui": "^1.0.105-alpha.35",
- "@budibase/frontend-core": "^1.0.105-alpha.35",
- "@budibase/string-templates": "^1.0.105-alpha.35",
+ "@budibase/bbui": "^1.0.105-alpha.42",
+ "@budibase/frontend-core": "^1.0.105-alpha.42",
+ "@budibase/string-templates": "^1.0.105-alpha.42",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",
diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json
index 7e482e0878..984ae7d922 100644
--- a/packages/frontend-core/package.json
+++ b/packages/frontend-core/package.json
@@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
- "@budibase/bbui": "^1.0.105-alpha.35",
+ "@budibase/bbui": "^1.0.105-alpha.42",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}
diff --git a/packages/server/package.json b/packages/server/package.json
index 55730d61e1..71a97da731 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@@ -68,10 +68,10 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "^10.0.3",
- "@budibase/backend-core": "^1.0.105-alpha.35",
- "@budibase/client": "^1.0.105-alpha.35",
- "@budibase/pro": "1.0.105-alpha.34",
- "@budibase/string-templates": "^1.0.105-alpha.35",
+ "@budibase/backend-core": "^1.0.105-alpha.42",
+ "@budibase/client": "^1.0.105-alpha.42",
+ "@budibase/pro": "1.0.105-alpha.42",
+ "@budibase/string-templates": "^1.0.105-alpha.42",
"@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0",
@@ -160,6 +160,7 @@
"copyfiles": "^2.4.1",
"docker-compose": "^0.23.6",
"eslint": "^6.8.0",
+ "ioredis-mock": "^7.2.0",
"is-wsl": "^2.2.0",
"jest": "^27.0.5",
"jest-openapi": "^0.14.2",
diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts
index 4df08683f0..23266991ee 100644
--- a/packages/server/src/definitions/datasource.ts
+++ b/packages/server/src/definitions/datasource.ts
@@ -49,6 +49,7 @@ export enum SourceNames {
ORACLE = "ORACLE",
GOOGLE_SHEETS = "GOOGLE_SHEETS",
FIREBASE = "FIREBASE",
+ REDIS = "REDIS",
}
export enum IncludeRelationships {
diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts
index 7408c6e001..711e9d2262 100644
--- a/packages/server/src/integrations/index.ts
+++ b/packages/server/src/integrations/index.ts
@@ -11,6 +11,7 @@ const arangodb = require("./arangodb")
const rest = require("./rest")
const googlesheets = require("./googlesheets")
const firebase = require("./firebase")
+const redis = require("./redis")
const { SourceNames } = require("../definitions/datasource")
const environment = require("../environment")
@@ -26,6 +27,8 @@ const DEFINITIONS = {
[SourceNames.MYSQL]: mysql.schema,
[SourceNames.ARANGODB]: arangodb.schema,
[SourceNames.REST]: rest.schema,
+ [SourceNames.FIREBASE]: firebase.schema,
+ [SourceNames.REDIS]: redis.schema,
}
const INTEGRATIONS = {
@@ -42,6 +45,7 @@ const INTEGRATIONS = {
[SourceNames.REST]: rest.integration,
[SourceNames.FIREBASE]: firebase.integration,
[SourceNames.GOOGLE_SHEETS]: googlesheets.integration,
+ [SourceNames.REDIS]: redis.integration,
}
// optionally add oracle integration if the oracle binary can be installed
diff --git a/packages/server/src/integrations/redis.ts b/packages/server/src/integrations/redis.ts
new file mode 100644
index 0000000000..29971c4b62
--- /dev/null
+++ b/packages/server/src/integrations/redis.ts
@@ -0,0 +1,152 @@
+import {
+ DatasourceFieldTypes,
+ Integration,
+ QueryTypes,
+} from "../definitions/datasource"
+import Redis from "ioredis"
+
+module RedisModule {
+ interface RedisConfig {
+ host: string
+ port: number
+ username: string
+ password?: string
+ }
+
+ const SCHEMA: Integration = {
+ docs: "https://redis.io/docs/",
+ description: "",
+ friendlyName: "Redis",
+ datasource: {
+ host: {
+ type: "string",
+ required: true,
+ default: "localhost",
+ },
+ port: {
+ type: "number",
+ required: true,
+ default: 6379,
+ },
+ username: {
+ type: "string",
+ required: false,
+ },
+ password: {
+ type: "password",
+ required: false,
+ },
+ },
+ query: {
+ create: {
+ type: QueryTypes.FIELDS,
+ fields: {
+ key: {
+ type: DatasourceFieldTypes.STRING,
+ required: true,
+ },
+ value: {
+ type: DatasourceFieldTypes.STRING,
+ required: true,
+ },
+ ttl: {
+ type: DatasourceFieldTypes.NUMBER,
+ },
+ },
+ },
+ read: {
+ readable: true,
+ type: QueryTypes.FIELDS,
+ fields: {
+ key: {
+ type: DatasourceFieldTypes.STRING,
+ required: true,
+ },
+ },
+ },
+ delete: {
+ type: QueryTypes.FIELDS,
+ fields: {
+ key: {
+ type: DatasourceFieldTypes.STRING,
+ required: true,
+ },
+ },
+ },
+ command: {
+ readable: true,
+ displayName: "Redis Command",
+ type: QueryTypes.JSON,
+ },
+ },
+ }
+
+ class RedisIntegration {
+ private readonly config: RedisConfig
+ private client: any
+
+ constructor(config: RedisConfig) {
+ this.config = config
+ this.client = new Redis({
+ host: this.config.host,
+ port: this.config.port,
+ username: this.config.username,
+ password: this.config.password,
+ })
+ }
+
+ async disconnect() {
+ this.client.disconnect()
+ }
+
+ async redisContext(query: Function) {
+ try {
+ return await query()
+ } catch (err) {
+ throw new Error(`Redis error: ${err}`)
+ } finally {
+ this.disconnect()
+ }
+ }
+
+ async create(query: { key: string; value: string; ttl: number }) {
+ return this.redisContext(async () => {
+ const response = await this.client.set(query.key, query.value)
+ if (query.ttl) {
+ await this.client.expire(query.key, query.ttl)
+ }
+ return response
+ })
+ }
+
+ async read(query: { key: string }) {
+ return this.redisContext(async () => {
+ const response = await this.client.get(query.key)
+ return response
+ })
+ }
+
+ async delete(query: { key: string }) {
+ return this.redisContext(async () => {
+ const response = await this.client.del(query.key)
+ return response
+ })
+ }
+
+ async command(query: { json: string }) {
+ return this.redisContext(async () => {
+ const commands = query.json.trim().split(" ")
+ const pipeline = this.client.pipeline([commands])
+ const result = await pipeline.exec()
+ return {
+ response: result[0][1],
+ }
+ })
+ }
+ }
+
+ module.exports = {
+ schema: SCHEMA,
+ integration: RedisIntegration,
+ }
+}
diff --git a/packages/server/src/integrations/tests/redis.spec.js b/packages/server/src/integrations/tests/redis.spec.js
new file mode 100644
index 0000000000..219584bdb2
--- /dev/null
+++ b/packages/server/src/integrations/tests/redis.spec.js
@@ -0,0 +1,60 @@
+const Redis = require("ioredis-mock")
+const RedisIntegration = require("../redis")
+
+class TestConfiguration {
+ constructor(config = {}) {
+ this.integration = new RedisIntegration.integration(config)
+ this.redis = new Redis({
+ data: {
+ test: 'test',
+ result: "1"
+ },
+ })
+ this.integration.client = this.redis
+ }
+}
+
+describe("Redis Integration", () => {
+ let config
+
+ beforeEach(() => {
+ config = new TestConfiguration()
+ })
+
+ it("calls the create method with the correct params", async () => {
+ const body = {
+ key: "key",
+ value: "value"
+ }
+ const response = await config.integration.create(body)
+ expect(await config.redis.get("key")).toEqual("value")
+ })
+
+ it("calls the read method with the correct params", async () => {
+ const body = {
+ key: "test"
+ }
+ const response = await config.integration.read(body)
+ expect(response).toEqual("test")
+ })
+
+ it("calls the delete method with the correct params", async () => {
+ const body = {
+ key: "test"
+ }
+ await config.integration.delete(body)
+ expect(await config.redis.get(body.key)).toEqual(null)
+ })
+
+ it("calls the command method with the correct params", async () => {
+ const body = {
+ json: "KEYS *"
+ }
+
+ // ioredis-mock doesn't support pipelines
+ config.integration.client.pipeline = jest.fn(() => ({ exec: jest.fn(() => [[]]) }))
+
+ await config.integration.command(body)
+ expect(config.integration.client.pipeline).toHaveBeenCalledWith([["KEYS", "*"]])
+ })
+})
\ No newline at end of file
diff --git a/packages/server/src/threads/utils.js b/packages/server/src/threads/utils.js
index bf89791874..5d8dc115e5 100644
--- a/packages/server/src/threads/utils.js
+++ b/packages/server/src/threads/utils.js
@@ -72,6 +72,7 @@ exports.hasExtraData = response => {
return (
typeof response === "object" &&
!Array.isArray(response) &&
+ response &&
response.data != null &&
response.info != null
)
diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock
index 4e96e86028..4537e7efb8 100644
--- a/packages/server/yarn.lock
+++ b/packages/server/yarn.lock
@@ -1014,10 +1014,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
-"@budibase/backend-core@^1.0.0":
- version "1.0.115"
- resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.115.tgz#c188dc9d4abe8f7d8088c54aeaa9f9c620bbbdba"
- integrity sha512-QGTaYyXWIInlKFzL514vDUh2gNob3Tckt1Lvtjk3Z5hhx2K7JZ5T2JwxSJ3qOBRKG6h2jI6HxlKEXPUefETAVA==
+"@budibase/backend-core@1.0.105-alpha.40":
+ version "1.0.105-alpha.40"
+ resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.105-alpha.40.tgz#7e8e3c548d09001a002364d2a9fa4dabf2d1bcce"
+ integrity sha512-lOUJx5yFAcBld+SNwbO1hUV2ucM2J+Y4AIG0BQeNH2kPul74sHlZpEocbmNu+R88NgKinTLcnB0wCdoD0MP+4g==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@@ -1087,12 +1087,12 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
-"@budibase/pro@1.0.105-alpha.34":
- version "1.0.105-alpha.34"
- resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.105-alpha.34.tgz#75cdb7e29a22b6dc7e2d2846d8fce95be22bedb4"
- integrity sha512-OSPNjXYI2awQfKzGEDRjPVn/4R1Dd9xFhBwirrwq3BRrhBJbHg7uKRELCJfiLu7wsEqZSZqqbH5Ugyxcj8n+PQ==
+"@budibase/pro@1.0.105-alpha.40":
+ version "1.0.105-alpha.40"
+ resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.105-alpha.40.tgz#155952a2645b547cb974a3c1bccb17f3075849e2"
+ integrity sha512-qrd7vxBkLcLoxWVtakg1P8M7NZUVM5d/ROveUsS1pDAVQndiI8fVrc7YeOfIiHmqdaFQXbwp9tn6ZviMuihVsA==
dependencies:
- "@budibase/backend-core" "^1.0.0"
+ "@budibase/backend-core" "1.0.105-alpha.40"
node-fetch "^2.6.1"
"@budibase/standard-components@^0.9.139":
@@ -5844,6 +5844,20 @@ fecha@^4.2.0:
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.1.tgz#0a83ad8f86ef62a091e22bb5a039cd03d23eecce"
integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==
+fengari-interop@^0.1.3:
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/fengari-interop/-/fengari-interop-0.1.3.tgz#3ad37a90e7430b69b365441e9fc0ba168942a146"
+ integrity sha512-EtZ+oTu3kEwVJnoymFPBVLIbQcCoy9uWCVnMA6h3M/RqHkUBsLYp29+RRHf9rKr6GwjubWREU1O7RretFIXjHw==
+
+fengari@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/fengari/-/fengari-0.1.4.tgz#72416693cd9e43bd7d809d7829ddc0578b78b0bb"
+ integrity sha512-6ujqUuiIYmcgkGz8MGAdERU57EIluGGPSUgGPTsco657EHa+srq0S3/YUl/r9kx1+D+d4rGfYObd+m8K22gB1g==
+ dependencies:
+ readline-sync "^1.4.9"
+ sprintf-js "^1.1.1"
+ tmp "^0.0.33"
+
fetch-cookie@0.10.1:
version "0.10.1"
resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-0.10.1.tgz#5ea88f3d36950543c87997c27ae2aeafb4b5c4d4"
@@ -6960,6 +6974,16 @@ invert-kv@^2.0.0:
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02"
integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==
+ioredis-mock@^7.2.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/ioredis-mock/-/ioredis-mock-7.2.0.tgz#48f006c07ef7f1f93f75e60d8f9035fa46c4ef0a"
+ integrity sha512-xzABBG3NhfDBGxH1KX9n6vs7WGNn9lhcxMT3b+vjynVImxlUV+vOXU+tjGzSUnGmx4IYllA8RqbXN8z6ROMPVA==
+ dependencies:
+ fengari "^0.1.4"
+ fengari-interop "^0.1.3"
+ redis-commands "^1.7.0"
+ standard-as-callback "^2.1.0"
+
ioredis@^4.27.0:
version "4.28.0"
resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.0.tgz#5a2be3f37ff2075e2332f280eaeb02ab4d9ff0d3"
@@ -11122,6 +11146,11 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
+readline-sync@^1.4.9:
+ version "1.4.10"
+ resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b"
+ integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==
+
realpath-native@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c"
@@ -11163,7 +11192,7 @@ rechoir@^0.7.0:
dependencies:
resolve "^1.9.0"
-redis-commands@1.7.0:
+redis-commands@1.7.0, redis-commands@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.7.0.tgz#15a6fea2d58281e27b1cd1acfb4b293e278c3a89"
integrity sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==
@@ -11974,7 +12003,7 @@ split2@^4.1.0:
resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809"
integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==
-sprintf-js@^1.1.2:
+sprintf-js@^1.1.1, sprintf-js@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673"
integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==
diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json
index 1b352bb9fe..3d0e585f73 100644
--- a/packages/string-templates/package.json
+++ b/packages/string-templates/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",
diff --git a/packages/worker/package.json b/packages/worker/package.json
index 14f9fe48c4..52f47f2d09 100644
--- a/packages/worker/package.json
+++ b/packages/worker/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
- "version": "1.0.105-alpha.35",
+ "version": "1.0.105-alpha.42",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@@ -31,9 +31,9 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
- "@budibase/backend-core": "^1.0.105-alpha.35",
- "@budibase/pro": "1.0.105-alpha.34",
- "@budibase/string-templates": "^1.0.105-alpha.35",
+ "@budibase/backend-core": "^1.0.105-alpha.42",
+ "@budibase/pro": "1.0.105-alpha.42",
+ "@budibase/string-templates": "^1.0.105-alpha.42",
"@koa/router": "^8.0.0",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "^0.3.0",
diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock
index ffb20ec1d5..59cb73118a 100644
--- a/packages/worker/yarn.lock
+++ b/packages/worker/yarn.lock
@@ -286,10 +286,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
-"@budibase/backend-core@^1.0.0":
- version "1.0.115"
- resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.115.tgz#c188dc9d4abe8f7d8088c54aeaa9f9c620bbbdba"
- integrity sha512-QGTaYyXWIInlKFzL514vDUh2gNob3Tckt1Lvtjk3Z5hhx2K7JZ5T2JwxSJ3qOBRKG6h2jI6HxlKEXPUefETAVA==
+"@budibase/backend-core@1.0.105-alpha.38":
+ version "1.0.105-alpha.38"
+ resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.105-alpha.38.tgz#399bc37877392f04c0072936d1c74d35d2997d6c"
+ integrity sha512-IKVw3+a42Yea49Qc8vbVd+KZzOIAfgAFEohApJZSxqKA5UaFeWPJ343LQ7oC6jbYOkRVlGRnkrvXXa1jRggqbA==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@@ -310,12 +310,12 @@
uuid "^8.3.2"
zlib "^1.0.5"
-"@budibase/pro@1.0.105-alpha.34":
- version "1.0.105-alpha.34"
- resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.105-alpha.34.tgz#75cdb7e29a22b6dc7e2d2846d8fce95be22bedb4"
- integrity sha512-OSPNjXYI2awQfKzGEDRjPVn/4R1Dd9xFhBwirrwq3BRrhBJbHg7uKRELCJfiLu7wsEqZSZqqbH5Ugyxcj8n+PQ==
+"@budibase/pro@1.0.105-alpha.38":
+ version "1.0.105-alpha.38"
+ resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.105-alpha.38.tgz#f025daf5667798083a7b0af301d6231dc3e58f00"
+ integrity sha512-TXSov/c2KT7YuxZRspSd4iNPZPiJOdpl91ZTxGrqaPfK8PDmgk/XBWkHci+z1WLCvf6YY2kuQJGp1moldoLO1g==
dependencies:
- "@budibase/backend-core" "^1.0.0"
+ "@budibase/backend-core" "1.0.105-alpha.38"
node-fetch "^2.6.1"
"@cspotcode/source-map-consumer@0.8.0":
diff --git a/scripts/link-dependencies.sh b/scripts/link-dependencies.sh
index bb4b1f4f0d..8c4294fa08 100755
--- a/scripts/link-dependencies.sh
+++ b/scripts/link-dependencies.sh
@@ -9,13 +9,17 @@ yarn link
cd -
if [ -d "../budibase-pro" ]; then
- cd ../budibase-pro/packages/pro
+ cd ../budibase-pro
+ yarn bootstrap
+
+ cd packages/pro
echo "Linking pro"
yarn link
echo "Linking backend-core to pro"
yarn link '@budibase/backend-core'
- cd -
+
+ cd ../../../budibase
echo "Linking pro to worker"
cd packages/worker && yarn link '@budibase/pro'
diff --git a/scripts/pro/release.sh b/scripts/pro/release.sh
index 4b30fa4b1d..c505c45c28 100755
--- a/scripts/pro/release.sh
+++ b/scripts/pro/release.sh
@@ -5,18 +5,16 @@ if [[ -z "${CI}" ]]; then
exit 0
fi
-# Release pro as same version as budibase
+#############################################
+# SETUP #
+#############################################
+
+# Release pro with same version as budibase
VERSION=$(jq -r .version lerna.json)
echo "Version: $VERSION"
COMMAND=$1
echo "Command: $COMMAND"
-# Go to pro package
-cd ../budibase-pro
-
-# Install NPM credentials
-echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
-
# Determine tag to use
TAG=""
if [[ $COMMAND == "develop" ]]; then
@@ -27,24 +25,70 @@ fi
echo "Releasing version $VERSION"
echo "Releasing tag $TAG"
+
+#############################################
+# PRE-PUBLISH #
+#############################################
+
+# Go to pro repo root
+cd ../budibase-pro
+
+# Install NPM credentials
+echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
+
+# Sync backend-core version in packages/pro/package.json
+# Ensures pro does not use out of date dependency
+cd packages/pro
+jq '.dependencies."@budibase/backend-core"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
+
+# Go back to pro repo root
+cd -
+
+#############################################
+# PUBLISH #
+#############################################
+
lerna publish $VERSION --yes --force-publish --dist-tag $TAG
-# reset main and types to point to src for dev
+#############################################
+# POST-PUBLISH - PRO #
+#############################################
+
+# Revert build changes on packages/pro/package.json
cd packages/pro
jq '.main = "src/index.ts" | .types = "src/index.ts"' package.json > package.json.tmp && mv package.json.tmp package.json
+
+# Go back to pro repo root
cd -
+
+# Commit and push changes
git add packages/pro/package.json
-git commit -m 'Prep dev'
+git commit -m "Prep next development iteration"
git push
+#############################################
+# POST-PUBLISH - BUDIBASE #
+#############################################
+
+# Go to budibase repo root
cd ../budibase
-if [[ $COMMAND == "develop" ]]; then
- # Pin pro version for develop container build
- echo "Pinning pro version"
- cd packages/server
- jq '.dependencies."@budibase/pro"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
- cd -
- cd packages/worker
- jq '.dependencies."@budibase/pro"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
-fi
+# Update pro version in packages/server/package.json
+cd packages/server
+jq '.dependencies."@budibase/pro"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
+
+# Go back to budibase repo root
+cd -
+
+# Update pro version in packages/worker/package.json
+cd packages/worker
+jq '.dependencies."@budibase/pro"="'$VERSION'"' package.json > package.json.tmp && mv package.json.tmp package.json
+
+# Go back to budibase repo root
+cd -
+
+# Commit and push changes
+git add packages/server/package.json
+git add packages/worker/package.json
+git commit -m "Update pro version to $VERSION"
+git push
\ No newline at end of file