Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/re.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../reverse_engineering/api');
5 changes: 4 additions & 1 deletion buildConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ const EXCLUDED_FILES = [
'.prettierignore',
'.prettierrc',
'.dockerignore',
'.sonarlint',
'.sonarcloud.properties',
'.npmrc',
'tsconfig.json',
'build',
'release',
'node_modules',
'package-lock.json',
];

module.exports = {
Expand Down
18 changes: 10 additions & 8 deletions esbuild.package.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const fs = require('fs');
const path = require('path');
const esbuild = require('esbuild');
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const { clean } = require('esbuild-plugin-clean');
const { copy } = require('esbuild-plugin-copy');
const { copyFolderFiles, addReleaseFlag } = require('@hackolade/hck-esbuild-plugins-pack');
const { EXCLUDED_EXTENSIONS, EXCLUDED_FILES, DEFAULT_RELEASE_FOLDER_PATH } = require('./buildConstants');
const { nodeExternalsPlugin } = require('esbuild-node-externals');

const packageData = JSON.parse(fs.readFileSync('./package.json').toString());
const RELEASE_FOLDER_PATH = path.join(DEFAULT_RELEASE_FOLDER_PATH, `${packageData.name}-${packageData.version}`);
Expand All @@ -13,6 +15,7 @@ esbuild
.build({
entryPoints: [
path.resolve(__dirname, 'api', 'fe.js'),
path.resolve(__dirname, 'api', 're.js'),
path.resolve(__dirname, 'forward_engineering', 'api.js'),
path.resolve(__dirname, 'forward_engineering', 'ddlProvider.js'),
path.resolve(__dirname, 'forward_engineering', 'dbtProvider.js'),
Expand All @@ -25,17 +28,11 @@ esbuild
outdir: RELEASE_FOLDER_PATH,
minify: true,
logLevel: 'info',
external: ['electron', 'lodash'],
plugins: [
clean({
patterns: [DEFAULT_RELEASE_FOLDER_PATH],
}),
copy({
assets: {
from: [path.join('node_modules', 'lodash', '**', '*')],
to: [path.join('node_modules', 'lodash')],
},
}),
nodeExternalsPlugin(),
copyFolderFiles({
fromPath: __dirname,
targetFolderPath: RELEASE_FOLDER_PATH,
Expand All @@ -45,4 +42,9 @@ esbuild
addReleaseFlag(path.resolve(RELEASE_FOLDER_PATH, 'package.json')),
],
})
.then(async () => {
const { stdout, stderr } = await exec(`npm ci --omit=dev`, { cwd: RELEASE_FOLDER_PATH });
console.log('stdout:', stdout);
console.log('stderr:', stderr);
})
.catch(() => process.exit(1));
2 changes: 1 addition & 1 deletion forward_engineering/helpers/applyToInstanceHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const execute = async (bigquery, query, location) => {
const applyToInstance = async (connectionInfo, logger, app) => {
const _ = app.require('lodash');
const async = app.require('async');
const connection = connectionHelper.connect(connectionInfo);
const connection = await connectionHelper.connect(connectionInfo);
const dataLocation = connectionInfo.containerData?.[0]?.dataLocation;
const location = dataLocation === 'default' ? '' : dataLocation;

Expand Down
Loading