Merge branch 'master' of github.com:Budibase/budibase into version-complibrary

This commit is contained in:
mike12345567 2020-10-21 15:33:23 +01:00
commit 2550c45831
9 changed files with 700 additions and 274 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "0.2.5", "version": "0.2.6",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "0.2.5", "version": "0.2.6",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -64,7 +64,7 @@
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.44.1", "@budibase/bbui": "^1.44.1",
"@budibase/client": "^0.2.5", "@budibase/client": "^0.2.6",
"@budibase/colorpicker": "^1.0.1", "@budibase/colorpicker": "^1.0.1",
"@fortawesome/fontawesome-free": "^5.14.0", "@fortawesome/fontawesome-free": "^5.14.0",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "budibase", "name": "budibase",
"version": "0.2.5", "version": "0.2.6",
"description": "Budibase CLI", "description": "Budibase CLI",
"repository": "https://github.com/Budibase/Budibase", "repository": "https://github.com/Budibase/Budibase",
"homepage": "https://www.budibase.com", "homepage": "https://www.budibase.com",
@ -17,7 +17,7 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/server": "^0.2.5", "@budibase/server": "^0.2.6",
"@inquirer/password": "^0.0.6-alpha.0", "@inquirer/password": "^0.0.6-alpha.0",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "0.2.5", "version": "0.2.6",
"license": "MPL-2.0", "license": "MPL-2.0",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
"module": "dist/budibase-client.esm.mjs", "module": "dist/budibase-client.esm.mjs",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"version": "0.2.5", "version": "0.2.6",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/electron.js", "main": "src/electron.js",
"repository": { "repository": {
@ -42,7 +42,7 @@
"author": "Michael Shanks", "author": "Michael Shanks",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/client": "^0.2.5", "@budibase/client": "^0.2.6",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sendgrid/mail": "^7.1.1", "@sendgrid/mail": "^7.1.1",
"@sentry/node": "^5.19.2", "@sentry/node": "^5.19.2",
@ -57,6 +57,7 @@
"electron-updater": "^4.3.1", "electron-updater": "^4.3.1",
"fix-path": "^3.0.0", "fix-path": "^3.0.0",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"jimp": "^0.16.1",
"joi": "^17.2.1", "joi": "^17.2.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"koa": "^2.7.0", "koa": "^2.7.0",
@ -74,7 +75,6 @@
"pouchdb-all-dbs": "^1.0.2", "pouchdb-all-dbs": "^1.0.2",
"pouchdb-replication-stream": "^1.2.9", "pouchdb-replication-stream": "^1.2.9",
"sanitize-s3-objectkey": "^0.0.1", "sanitize-s3-objectkey": "^0.0.1",
"sharp": "^0.26.0",
"squirrelly": "^7.5.0", "squirrelly": "^7.5.0",
"tar-fs": "^2.1.0", "tar-fs": "^2.1.0",
"uuid": "^3.3.2", "uuid": "^3.3.2",

View File

@ -165,15 +165,14 @@ exports.serveApp = async function(ctx) {
exports.serveAttachment = async function(ctx) { exports.serveAttachment = async function(ctx) {
const appId = ctx.user.appId const appId = ctx.user.appId
const attachmentsPath = resolve(budibaseAppsDir(), appId, "attachments") const attachmentsPath = resolve(budibaseAppsDir(), appId, "attachments")
// Serve from CloudFront // Serve from CloudFront
if (process.env.CLOUD) { if (process.env.CLOUD) {
const S3_URL = `https://cdn.app.budi.live/assets/${appId}/attachments/${ctx.file}` const S3_URL = `https://cdn.app.budi.live/assets/${appId}/attachments/${ctx.file}`
const response = await fetch(S3_URL) const response = await fetch(S3_URL)
const body = await response.text() const body = await response.text()
ctx.set("Content-Type", response.headers.get("Content-Type"))
ctx.body = body ctx.body = body
return return
} }

View File

@ -1,24 +1,21 @@
const fs = require("fs") const fs = require("fs")
const sharp = require("sharp") const jimp = require("jimp")
const fsPromises = fs.promises const fsPromises = fs.promises
const FORMATS = { const FORMATS = {
IMAGES: ["png", "jpg", "jpeg", "gif", "svg", "tiff", "raw"], IMAGES: ["png", "jpg", "jpeg", "gif", "bmp", "tiff"],
} }
async function processImage(file) { function processImage(file) {
const imgMeta = await sharp(file.path) return jimp.read(file.path).then(img => {
.resize(300) return img.resize(300, jimp.AUTO).write(file.outputPath)
.toFile(file.outputPath) })
return {
...file,
...imgMeta,
}
} }
async function process(file) { async function process(file) {
if (FORMATS.IMAGES.includes(file.extension.toLowerCase())) { if (FORMATS.IMAGES.includes(file.extension.toLowerCase())) {
return await processImage(file) await processImage(file)
return file
} }
// No processing required // No processing required

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"devDependencies": { "devDependencies": {
"@budibase/client": "^0.2.5", "@budibase/client": "^0.2.6",
"@rollup/plugin-commonjs": "^11.1.0", "@rollup/plugin-commonjs": "^11.1.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"rollup": "^2.11.2", "rollup": "^2.11.2",
@ -32,7 +32,7 @@
"keywords": [ "keywords": [
"svelte" "svelte"
], ],
"version": "0.2.5", "version": "0.2.6",
"license": "MIT", "license": "MIT",
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
"dependencies": { "dependencies": {