多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

284 lines
7.8 KiB

import MonacoEditorWebpackPlugin from 'monaco-editor-webpack-plugin'
// import HtmlWebpackPlugin from 'html-webpack-plugin';
const fs = require('fs')
const packageJson = JSON.parse(fs.readFileSync('../nc-lib-gui/package.json', 'utf8'))
export default {
/*
** Nuxt rendering mode
** See https://nuxtjs.org/api/configuration-mode
*/
mode: 'spa',
// ssr: false,
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: 'server',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
head: {
titleTemplate: '',
title: 'NocoDB',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [
{
rel: 'icon',
type: 'image/x-icon',
href: './favicon-32.png'
}
]
},
/*
** Global CSS
*/
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: [
{ src: '~plugins/api.js' },
'~/plugins/xutils.js',
{
src: '~plugins/localStorage.js',
ssr: false
},
{
src: '~plugins/confetti.js',
ssr: false
},
0.91.8 Pre-release (#2350) * add vscode ide's ignore list * fix passing nested query in nested getAst calls * chore: update nocodb-sdk to local path * fix: ignore duplicating app config Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: swagger columnNameParam type re: #2208 Signed-off-by: mertmit <mertmit99@gmail.com> * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] * enhancement: hide slider on escape key Signed-off-by: Pranav C <pranavxc@gmail.com> * Add information about maximum value for `limit` in REST API * refactor: folder structure * refactor: folder structure * test: webhook (WIP) Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * test: webhook Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * test/cypress: corrections post develop branch refactoring Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * fix: handle null Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: path correction Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: assign validation for correct column(LTAR) re #2228 Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: disable api docs access for viewer role Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * docs: Repair broken link * fix: DatePickerCell invalid date handling Signed-off-by: mertmit <mertmit99@gmail.com> * fix: nested insert correction in belongs to re #2228 Signed-off-by: Pranav C <pranavxc@gmail.com> * feat: compare with non-os products Signed-off-by: mertmit <mertmit99@gmail.com> * fix: Persian language moving across table Signed-off-by: mertmit <mertmit99@gmail.com> * docs: env variables * docs: env variables reorder * docs: env variables reorder * fix: i18n corrections (WeT-Klb) Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * chore: image text corrections (@WeT-Klb) * chore: upgrade nc-help Signed-off-by: Pranav C <pranavxc@gmail.com> * docs: security.md * Update packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts Co-authored-by: աɨռɢӄաօռɢ <wingkwong.code@gmail.com> * Update SqliteUi.ts - set float for decimal case in getAbstractType (#2260) * set float for decimal case in getAbstractType * fix: add cross-env to nc-gui package.json (#2275) * add cross-env to nc-gui package.json * fix: sanitize project title * chore: disable pr release for draft * chore: attachment log during airtable import Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * modification of the traduction I aslo add some stuff according to the README (it was a different display so i didn't add a lot) * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] * fix: change password cache logic * fix: add missing job name back * fix: prop types for FlipCard component Signed-off-by: mertmit <mertmit99@gmail.com> * fix: invalid char in content-disposition header Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * fix: question mark in CONCAT * fix: handling lookup column reference in formula Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: throw err if user is already a project user * chore: revise error msg * fix: package lock corrections Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * test/ trigger Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * fix: lock file version Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * fix: package lock after npm/node upgrade Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * fix: cypress package lock json Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * test: lock node-version to 16.15.0 Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> * enhancement: allow custom limit values * chore: update query limit description * chore: bump to 16.15.0 * fix: node version * fix: handle invalid limit numbers Signed-off-by: Pranav C <pranavxc@gmail.com> * docs: update default value of pagination max limit value Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: pg database type money Signed-off-by: mertmit <mertmit99@gmail.com> * fix: hasmany pagination - api correction re #2242 Signed-off-by: Pranav C <pranavxc@gmail.com> * script: add nc_017_add_user_token_exp_column * fix: add token_expired * fix: return unauthorized if token is expired * chore: revise toast message * chore: sign out n redirect to sign in page after changing password * fix: SingeSelect/MultiSelect webhook trigger (#2309) * fix: SingleSelect webhook trigger Signed-off-by: mertmit <mertmit99@gmail.com> * fix: MultiSelect webhook trigger Signed-off-by: mertmit <mertmit99@gmail.com> * Fix: Remove user reference from webhook context (#2337) * fix: remove user info from webhook handlebar context Signed-off-by: Pranav C <pranavxc@gmail.com> * docs: update webhook context variables docs Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: only check token_expired in non-public base * fix: make rating readonly in lookup column (#2340) re #2045 Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: exclude sensitive data related to server from SMTP test api Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: session across broswers * fix: reload related table metadata after relation column delete (#2345) re #2344 Signed-off-by: Pranav C <pranavxc@gmail.com> * Fix: Sanitise comment data (#2343) * fix: sanitise row comment description Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: add dom purify and sanitize content - Add DOMPurify in nuxt - On update value encode html tags to render as text in comment Signed-off-by: Pranav C <pranavxc@gmail.com> * fix: add missing dependency Signed-off-by: Pranav C <pranavxc@gmail.com> Co-authored-by: cattong <tangym@jifenbang.net> Co-authored-by: LepkoQQ <LepkoQQ@users.noreply.github.com> Co-authored-by: Pranav C <pranavxc@gmail.com> Co-authored-by: mertmit <mertmit99@gmail.com> Co-authored-by: navi <oof1lab@gmail.com> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Nils Reichardt <nils@reichardt.io> Co-authored-by: Raju Udava <86527202+dstala@users.noreply.github.com> Co-authored-by: Toon van Ramshorst <ramshorst@gmail.com> Co-authored-by: GurukiranMH <89529565+GurukiranMH@users.noreply.github.com> Co-authored-by: QuentinDstl <qdesautel@gmail.com>
3 years ago
{
src: '~plugins/domPurify.js',
ssr: false
},
{
src: '~plugins/axiosInterceptor.js',
ssr: false
},
'@/plugins/veeValidate',
'@/plugins/vueTour',
{
src: '@/plugins/vueShortkey',
ssr: false
},
'@/plugins/vueClipboard',
'@/plugins/globalComponentLoader',
'@/plugins/globalMixin',
'@/plugins/globalEventBus',
'@/plugins/ncApis',
'~/plugins/i18n.js',
{
src: '~plugins/projectLoader.js',
ssr: false
},
{
src: '~/plugins/tele.js',
ssr: false
}
],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
// components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxtjs/vuetify'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'vue-github-buttons/nuxt',
'@nuxtjs/toast'
],
toast: {
position: 'top-center'
},
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
baseURL: process.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? '..' : 'http://localhost:8080')
},
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
router: {
mode: 'hash',
// base: '/xc/',
middleware: ['auth']
},
vuetify: {
defaultAssets: {
// font: false,
icons: false
},
optionsPath: '@/config/vuetify.options.js',
treeShake: true,
customVariables: ['./config/variables.scss']
},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {
parallel: true,
plugins: [
new MonacoEditorWebpackPlugin({
// https://github.com/Microsoft/monaco-editor-webpack-plugin#options
// Include a subset of languages support
// Some language extensions like typescript are so huge that may impact build performance
// e.g. Build full languages support with webpack 4.0 takes over 80 seconds
// Languages are loaded on demand at runtime
languages: ['sql', 'json', 'javascript'],
features: ['!gotoSymbol']
})
],
// publicPath: process.env.NODE_ENV === 'production' ? `https://cdn.jsdelivr.net/npm/nc-lib-gui@${version}/lib/dist/` : undefined,
publicPath: process.env.NODE_ENV === 'production' ? './_nuxt/' : undefined,
extend(config, {
isDev,
isClient
}) {
if (isDev) {
config.devtool = isClient ? 'source-map' : 'inline-source-map'
}
config.externals = config.externals || {}
config.externals['@microsoft/typescript-etw'] = 'FakeModule'
// config.plugins.push(new MonacoEditorWebpackPlugin({
// languages: ['javascript', 'typescript', 'json', 'mysql', 'sql', 'pgsql'],
// features: ['!gotoSymbol', '!goToCommands']
// }))
if (!isDev) {
// const WebpackObfuscator = require('webpack-obfuscator');
// config.plugins.push(new WebpackObfuscator({
// compact: true,
// controlFlowFlattening: false,
// deadCodeInjection: false,
// debugProtection: false,
// debugProtectionInterval: false,
// disableConsoleOutput: true,
// identifierNamesGenerator: 'hexadecimal',
// log: false,
// numbersToExpressions: false,
// renameGlobals: false,
// rotateStringArray: true,
// selfDefending: true,
// shuffleStringArray: true,
// simplify: true,
// splitStrings: false,
// stringArray: true,
// stringArrayEncoding: false,
// stringArrayThreshold: 0.75,
// unicodeEscapeSequence: false
// }))
// relative links, please.
// config.output.publicPath = "http://35.244.225.21/_nuxt/";
// config.output.publicPath = "./_nuxt/";
// NOTE: future release version of xc-lib-gui
if (process.env.targetEnv === 'DEV') {
// nightly build
// e.g. 0.84.2-20220220-1250
packageJson.version = `${packageJson.version}-${process.env.targetVersion}`
packageJson.name += '-daily'
} else {
packageJson.version = process.env.targetVersion
}
fs.writeFileSync('../nc-lib-gui/package.json', JSON.stringify(packageJson, 0, 2))
// config.output.publicPath = `https://cdn.jsdelivr.net/npm/nc-lib-gui@${version}/lib/dist/`;
// const htmlWebpack = config.plugins.find(w => w instanceof HtmlWebpackPlugin);
// htmlWebpack.options.publicPath = `https://cdn.jsdelivr.net/npm/xc-lib-gui@${version}/lib/dist/_nuxt/`;
// const templateParams = htmlWebpack.templateParameters
// htmlWebpack.templateParameters = (...args) =>{
// const res = templateParams(...args);
// return res;
// };
}
if (!isDev) {
config.output.publicPath = './_nuxt/'
}
return config
}
},
loading: {
color: '#13f4ef',
height: '0px',
continuous: true,
duration: 3000
},
css: [
'@/assets/style/fonts.css',
'@/assets/css/global.css',
// "~/assets/style/app.styl",
'@mdi/font/css/materialdesignicons.css',
'~/assets/style/style.css',
'~/assets/style.css',
'material-design-icons-iconfont/dist/material-design-icons.css'
],
env: {
EE: !!process.env.EE,
NC_API_URL: 'https://nocodb.com'
},
pwa: {
workbox: {
/* workbox options */
assetsURLPattern: './_nuxt/',
pagesURLPattern: './'
},
manifest: {
publicPath: './'
}
}
}
/**
* @copyright Copyright (c) 2021, Xgene Cloud Ltd
*
* @author Naveen MR <oof1lab@gmail.com>
* @author Pranav C Balan <pranavxc@gmail.com>
* @author Wing-Kam Wong <wingkwong.code@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/