Browse Source

fix: update configs

DarkPhoenix2704 3 days ago
parent
commit
cef8aa514f
No known key found for this signature in database
GPG Key ID: 3F76B10622A07849
  1. 2
      build-local-docker-image.sh
  2. 25
      packages/nocodb-sdk/src/lib/Api.ts
  3. 5
      packages/nocodb/package.json
  4. 10
      packages/nocodb/rspack.cli.config.js
  5. 26
      packages/nocodb/rspack.config.js
  6. 8
      packages/nocodb/rspack.dev.config.js
  7. 85
      packages/nocodb/rspack.local.config.js
  8. 8
      packages/nocodb/rspack.timely.config.js
  9. 813
      pnpm-lock.yaml

2
build-local-docker-image.sh

@ -45,7 +45,7 @@ function copy_gui_artifacts() {
function package_nocodb() { function package_nocodb() {
# build nocodb ( pack nocodb-sdk and nc-gui ) # build nocodb ( pack nocodb-sdk and nc-gui )
cd ${SCRIPT_DIR}/packages/nocodb cd ${SCRIPT_DIR}/packages/nocodb
EE=true ${SCRIPT_DIR}/node_modules/.bin/webpack --config ${SCRIPT_DIR}/packages/nocodb/webpack.local.config.js || ERROR="package_nocodb failed" EE=true ${SCRIPT_DIR}/node_modules/@rspack/cli/bin --config ${SCRIPT_DIR}/packages/nocodb/rspack.config.js || ERROR="package_nocodb failed"
} }
function build_image() { function build_image() {

25
packages/nocodb-sdk/src/lib/Api.ts

@ -3293,6 +3293,31 @@ export interface ExtensionType {
order?: number; order?: number;
} }
/**
* Model for Snapshot
*/
export interface SnapshotType {
/** Unique ID */
id?: IdType;
/** Title of the Snapshot */
title?: string;
/** Foreign Key to Base */
base_id?: IdType;
/** Foreign Key to Snapshot Base */
snapshot_base_id?: IdType;
/** Foreign Key to Workspace */
fk_workspace_id?: IdType;
/**
* Date of creation
* @format date
*/
created_at?: string;
/** User ID of the creator */
created_by?: IdType;
/** Status of the Snapshot */
status?: string;
}
export interface ExtensionReqType { export interface ExtensionReqType {
/** Unique Base ID */ /** Unique Base ID */
base_id?: IdType; base_id?: IdType;

5
packages/nocodb/package.json

@ -165,8 +165,8 @@
"@nestjs/schematics": "^10.1.1", "@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.8", "@nestjs/testing": "^10.3.8",
"@nestjsplus/dyn-schematics": "^1.0.12", "@nestjsplus/dyn-schematics": "^1.0.12",
"@rspack/cli": "^1.1.1", "@rspack/cli": "^1.1.4",
"@rspack/core": "^1.1.1", "@rspack/core": "^1.1.4",
"@swc-node/register": "^1.10.9", "@swc-node/register": "^1.10.9",
"@types/content-disposition": "^0.5.8", "@types/content-disposition": "^0.5.8",
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
@ -192,7 +192,6 @@
"jest": "29.7.0", "jest": "29.7.0",
"mocha": "^10.3.0", "mocha": "^10.3.0",
"node-loader": "^2.1.0", "node-loader": "^2.1.0",
"nodemon": "^3.0.3",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"run-script-webpack-plugin": "^0.2.0", "run-script-webpack-plugin": "^0.2.0",
"supertest": "^6.3.4", "supertest": "^6.3.4",

10
packages/nocodb/rspack.cli.config.js

@ -31,9 +31,11 @@ module.exports = {
], ],
nodeEnv: false, nodeEnv: false,
}, },
externals: [nodeExternals({ externals: [
allowlist: ['nocodb-sdk'] nodeExternals({
})], allowlist: ['nocodb-sdk'],
}),
],
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'], extensions: ['.tsx', '.ts', '.js', '.json'],
tsConfig: { tsConfig: {
@ -61,4 +63,4 @@ module.exports = {
}), }),
], ],
target: 'node', target: 'node',
}; };

26
packages/nocodb/rspack.config.js

@ -1,6 +1,7 @@
const path = require('path'); const path = require('path');
const { rspack } = require('@rspack/core'); const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals'); const nodeExternals = require('webpack-node-externals');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = { module.exports = {
entry: './src/index.ts', entry: './src/index.ts',
@ -18,6 +19,7 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'builtin:swc-loader', loader: 'builtin:swc-loader',
options: { options: {
sourceMap: false,
jsc: { jsc: {
parser: { parser: {
syntax: 'typescript', syntax: 'typescript',
@ -30,9 +32,16 @@ module.exports = {
decoratorMetadata: true, decoratorMetadata: true,
}, },
target: 'es2017', target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
}, },
module: { module: {
type: 'commonjs', type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
}, },
}, },
}, },
@ -52,11 +61,13 @@ module.exports = {
], ],
nodeEnv: false, nodeEnv: false,
}, },
externals: [nodeExternals({ externals: [
allowlist: ['nocodb-sdk'] nodeExternals({
})], allowlist: ['nocodb-sdk'],
}),
],
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js', '.json'], extensions: ['.tsx', '.ts', '.js', '.json', '.node'],
tsConfig: { tsConfig: {
configFile: path.resolve('tsconfig.json'), configFile: path.resolve('tsconfig.json'),
}, },
@ -79,6 +90,11 @@ module.exports = {
new rspack.CopyRspackPlugin({ new rspack.CopyRspackPlugin({
patterns: [{ from: 'src/public', to: 'public' }], patterns: [{ from: 'src/public', to: 'public' }],
}), }),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: resolve('./src/tsconfig.build.json'),
},
})
], ],
target: 'node', target: 'node',
}; };

8
packages/nocodb/rspack.dev.config.js

@ -1,8 +1,8 @@
const { join, resolve } = require('path'); const { join } = require('path');
const { rspack } = require('@rspack/core'); const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin'); const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const baseDevConfig = { const baseDevConfig = {
mode: 'development', mode: 'development',
@ -53,7 +53,7 @@ const baseDevConfig = {
externals: [ externals: [
nodeExternals({ nodeExternals({
allowlist: ['webpack/hot/poll?1000'], allowlist: ['webpack/hot/poll?1000'],
}) }),
], ],
resolve: { resolve: {
extensions: ['.tsx', '.ts', '.js', '.json', '.node'], extensions: ['.tsx', '.ts', '.js', '.json', '.node'],
@ -102,4 +102,4 @@ const baseDevConfig = {
}, },
}; };
module.exports = baseDevConfig; module.exports = baseDevConfig;

85
packages/nocodb/rspack.local.config.js

@ -1,85 +0,0 @@
const path = require('path');
const { rspack } = require('@rspack/core');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/run/local.ts',
// devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.node$/,
loader: 'node-loader',
options: {
name: '[path][name].[ext]',
},
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
legacyDecorator: true,
decoratorMetadata: true,
},
target: 'es2017',
},
module: {
type: 'commonjs',
},
},
},
],
},
optimization: {
minimize: true, //Update this to true or false
minimizer: [
new rspack.SwcJsMinimizerRspackPlugin({
minimizerOptions: {
compress: {
keep_classnames: true,
},
},
}),
],
nodeEnv: false,
},
externals: [
nodeExternals({
allowlist: ['nocodb-sdk'],
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.json', '.node'],
tsConfig: {
configFile: path.resolve('tsconfig.json'),
},
},
mode: 'production',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'docker'),
library: 'libs',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
node: {
__dirname: false,
},
plugins: [
new rspack.EnvironmentPlugin({
EE: true,
}),
],
target: 'node',
};

8
packages/nocodb/rspack.timely.config.js

@ -18,6 +18,7 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'builtin:swc-loader', loader: 'builtin:swc-loader',
options: { options: {
sourceMap: false,
jsc: { jsc: {
parser: { parser: {
syntax: 'typescript', syntax: 'typescript',
@ -30,9 +31,16 @@ module.exports = {
decoratorMetadata: true, decoratorMetadata: true,
}, },
target: 'es2017', target: 'es2017',
loose: true,
externalHelpers: false,
keepClassNames: true,
}, },
module: { module: {
type: 'commonjs', type: 'commonjs',
strict: false,
strictMode: true,
lazy: false,
noInterop: false,
}, },
}, },
}, },

813
pnpm-lock.yaml

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save