From 8c288d4ed97cf76d32b5fc1d457ab23626ce5cb1 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Sun, 17 Nov 2024 11:53:09 +0530 Subject: [PATCH] fix: gtihub actions --- .github/workflows/release-timely-docker.yml | 2 +- packages/nocodb/rspack.cli.config.js | 9 ++------- packages/nocodb/rspack.config.js | 14 ++------------ packages/nocodb/rspack.dev.config.js | 20 +++----------------- packages/nocodb/rspack.local.config.js | 14 ++------------ packages/nocodb/rspack.timely.config.js | 14 ++------------ 6 files changed, 12 insertions(+), 61 deletions(-) diff --git a/.github/workflows/release-timely-docker.yml b/.github/workflows/release-timely-docker.yml index db7ec228ef..238dd90720 100644 --- a/.github/workflows/release-timely-docker.yml +++ b/.github/workflows/release-timely-docker.yml @@ -104,7 +104,7 @@ jobs: run: | # build nocodb ( pack nocodb-sdk and nc-gui ) cd packages/nocodb && - EE=true pnpm exec webpack --config webpack.timely.config.js && + EE=true pnpm exec rspack --config rspack.timely.config.js && # remove bundled libraries (nocodb-sdk, knex-snowflake) pnpm uninstall --save-prod nocodb-sdk diff --git a/packages/nocodb/rspack.cli.config.js b/packages/nocodb/rspack.cli.config.js index 218d81288d..381e9e978a 100644 --- a/packages/nocodb/rspack.cli.config.js +++ b/packages/nocodb/rspack.cli.config.js @@ -1,6 +1,7 @@ const path = require('path'); const { rspack } = require('@rspack/core'); const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); +const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/cli.ts', @@ -31,13 +32,7 @@ module.exports = { ], nodeEnv: false, }, - externals: { - 'nocodb-sdk': 'nocodb-sdk', - 'pg-query-stream': 'pg-query-stream', - 'better-sqlite3': 'better-sqlite3', - oracledb: 'oracledb', - 'pg-native': 'pg-native', - }, + externals: [nodeExternals()], resolve: { extensions: ['.tsx', '.ts', '.js', '.json'], alias: resolveTsAliases(path.resolve('tsconfig.json')), diff --git a/packages/nocodb/rspack.config.js b/packages/nocodb/rspack.config.js index 2b23469e71..66b6e8879f 100644 --- a/packages/nocodb/rspack.config.js +++ b/packages/nocodb/rspack.config.js @@ -1,6 +1,7 @@ const path = require('path'); const { rspack } = require('@rspack/core'); const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); +const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/index.ts', @@ -52,18 +53,7 @@ module.exports = { ], nodeEnv: false, }, - externals: { - '@nestjs/microservices': '@nestjs/microservices', - '@nestjs/microservices/microservices-module': - '@nestjs/microservices/microservices-module', - sharp: 'commonjs sharp', - 'nocodb-sdk': 'nocodb-sdk', - 'pg-query-stream': 'pg-query-stream', - 'better-sqlite3': 'better-sqlite3', - oracledb: 'oracledb', - 'pg-native': 'pg-native', - '@nestjs/graphql': '@nestjs/graphql', - }, + externals: [nodeExternals()], resolve: { extensions: ['.tsx', '.ts', '.js', '.json'], alias: resolveTsAliases(path.resolve('tsconfig.json')), diff --git a/packages/nocodb/rspack.dev.config.js b/packages/nocodb/rspack.dev.config.js index d2e4b180b6..9f9e540427 100644 --- a/packages/nocodb/rspack.dev.config.js +++ b/packages/nocodb/rspack.dev.config.js @@ -1,9 +1,9 @@ const { join, resolve } = require('path'); const { rspack } = require('@rspack/core'); -const NodeExternals = require('webpack-node-externals'); const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin'); const {resolveTsAliases} = require("./build-utils/resolveTsAliases"); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); +const nodeExternals = require('webpack-node-externals'); const baseDevConfig = { mode: 'development', @@ -52,23 +52,9 @@ const baseDevConfig = { ], }, externals: [ - NodeExternals({ + nodeExternals({ allowlist: ['webpack/hot/poll?1000'], - }), - { - '@nestjs/microservices': '@nestjs/microservices', - '@nestjs/microservices/microservices-module': - '@nestjs/microservices/microservices-module', - sharp: 'commonjs sharp', - 'nocodb-sdk': 'nocodb-sdk', - 'pg-query-stream': 'pg-query-stream', - 'better-sqlite3': 'better-sqlite3', - oracledb: 'oracledb', - 'pg-native': 'pg-native', - '@nestjs/graphql': '@nestjs/graphql', - pg: 'commonjs pg', - knex: 'commonjs knex', - }, + }) ], resolve: { extensions: ['.tsx', '.ts', '.js', '.json', '.node'], diff --git a/packages/nocodb/rspack.local.config.js b/packages/nocodb/rspack.local.config.js index 29a2dd7c08..1049e7648f 100644 --- a/packages/nocodb/rspack.local.config.js +++ b/packages/nocodb/rspack.local.config.js @@ -1,6 +1,7 @@ const path = require('path'); const { rspack } = require('@rspack/core'); const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); +const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/run/local.ts', @@ -53,18 +54,7 @@ module.exports = { ], nodeEnv: false, }, - externals: { - '@nestjs/microservices': '@nestjs/microservices', - '@nestjs/microservices/microservices-module': - '@nestjs/microservices/microservices-module', - sharp: 'commonjs sharp', - 'nocodb-sdk': 'nocodb-sdk', - 'pg-query-stream': 'pg-query-stream', - 'better-sqlite3': 'better-sqlite3', - oracledb: 'oracledb', - 'pg-native': 'pg-native', - '@nestjs/graphql': '@nestjs/graphql', - }, + externals: [nodeExternals()], resolve: { extensions: ['.tsx', '.ts', '.js', '.json', '.node'], alias: resolveTsAliases(path.resolve('tsconfig.json')), diff --git a/packages/nocodb/rspack.timely.config.js b/packages/nocodb/rspack.timely.config.js index b053d07879..58580ecd4c 100644 --- a/packages/nocodb/rspack.timely.config.js +++ b/packages/nocodb/rspack.timely.config.js @@ -1,6 +1,7 @@ const path = require('path'); const { rspack } = require('@rspack/core'); const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); +const nodeExternals = require('webpack-node-externals'); module.exports = { entry: './src/run/timely.ts', @@ -52,18 +53,7 @@ module.exports = { ], nodeEnv: false, }, - externals: { - '@nestjs/microservices': '@nestjs/microservices', - '@nestjs/microservices/microservices-module': - '@nestjs/microservices/microservices-module', - sharp: 'commonjs sharp', - 'nocodb-sdk': 'nocodb-sdk', - 'pg-query-stream': 'pg-query-stream', - 'better-sqlite3': 'better-sqlite3', - oracledb: 'oracledb', - 'pg-native': 'pg-native', - '@nestjs/graphql': '@nestjs/graphql', - }, + externals: [nodeExternals()], resolve: { extensions: ['.tsx', '.ts', '.js', '.json', '.node'], alias: resolveTsAliases(path.resolve('./tsconfig.json')),