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
5 changes: 1 addition & 4 deletions buildConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ const EXCLUDED_FILES = [
'.prettierignore',
'.prettierrc',
'.dockerignore',
'.sonarlint',
'.sonarcloud.properties',
'.npmrc',
'tsconfig.json',
'build',
'release',
'node_modules',
'package-lock.json',
];

module.exports = {
Expand Down
17 changes: 8 additions & 9 deletions esbuild.package.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
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 @@ -28,11 +26,17 @@ esbuild
outdir: RELEASE_FOLDER_PATH,
minify: true,
logLevel: 'info',
external: ['electron', 'lodash'],
plugins: [
clean({
patterns: [DEFAULT_RELEASE_FOLDER_PATH],
}),
nodeExternalsPlugin(),
copy({
assets: {
from: [path.join('node_modules', 'lodash', '**', '*')],
to: [path.join('node_modules', 'lodash')],
},
}),
copyFolderFiles({
fromPath: __dirname,
targetFolderPath: RELEASE_FOLDER_PATH,
Expand All @@ -42,9 +46,4 @@ 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));
149 changes: 133 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"dependencies": {
"@google-cloud/bigquery": "8.0.0",
"@hackolade/sql-select-statement-parser": "0.0.20",
"big.js": "6.2.2",
"fs-extra": "11.3.0",
"lodash": "4.17.21"
},
Expand All @@ -75,8 +74,8 @@
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"esbuild": "0.20.2",
"esbuild-node-externals": "1.18.0",
"esbuild-plugin-clean": "1.0.1",
"esbuild-plugin-copy": "2.1.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-formatter-teamcity": "^1.0.0",
Expand Down
Loading