Skip to content

Commit 6d1acf6

Browse files
committed
Ensure sqlite3 isn't egnored
Signed-off-by: Omkar Phansopkar <omkarphansopkar@gmail.com>
1 parent ce53a54 commit 6d1acf6

5 files changed

Lines changed: 31 additions & 23 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"sequelize-cli": "^6.5.1",
107107
"spdx-correct": "^3.1.1",
108108
"spdx-license-ids": "^3.0.12",
109-
"sqlite3": "5.1.2",
109+
"sqlite3": "^5.1.6",
110110
"url": "^0.11.0",
111111
"url-loader": "^4.1.1",
112112
"util": "^0.12.4"

src/pages/Home/Home.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,14 @@ import { useWorkbenchDB } from '../../contexts/workbenchContext'
1313
import CoreButton from '../../components/CoreButton/CoreButton';
1414
import ProgressLoader from '../../components/ProgressLoader/ProgressLoader'
1515

16-
import { ROUTES } from '../../constants/routes'
17-
import { GetHistory, HistoryItem, RemoveEntry } from '../../services/historyStore'
18-
1916
import { OPEN_DIALOG_CHANNEL } from '../../constants/IpcConnection';
17+
import { GetHistory, HistoryItem, RemoveEntry } from '../../services/historyStore'
2018

19+
import '../../utils/ensureRendererDeps';
2120
import './home.css'
2221

2322
const { ipcRenderer } = electron;
2423

25-
// console.log("Renderer Deps:", {
26-
// electron,
27-
// electronFs,
28-
// electronOs,
29-
// ipcRenderer,
30-
// platform: electronOs.platform(),
31-
// // remote,
32-
// // sqlite3,
33-
// // remoteMain,
34-
// });
3524

3625
// // Debugging for native modules
3726
// const electronDialog = electron.dialog;
@@ -44,11 +33,6 @@ const { ipcRenderer } = electron;
4433
* Developer options
4534
*/
4635

47-
const DEV_CONFIG = {
48-
AUTO_IMPORT_IN_DEV: false,
49-
GO_TO_ROUTE_ON_IMPORT: ROUTES.LICENSE_DETECTIONS,
50-
}
51-
5236
const Home = () => {
5337
const {
5438
db,

src/services/workbenchDB.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { FileAttributes } from "./models/file";
4545
import { flattenFile } from "./models/flatFile";
4646
import { UNKNOWN_EXPRESSION, UNKNOWN_EXPRESSION_SPDX } from "../constants/data";
4747

48+
4849
/**
4950
* Manages the database created from a ScanCode JSON input.
5051
* The database contains tables for both flattened and unflattened data

src/utils/ensureRendererDeps.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import electron from 'electron'
2+
import * as electronFs from "fs"
3+
import * as electronOs from "os"
4+
import sqlite3 from 'sqlite3';
5+
const { ipcRenderer } = electron;
6+
7+
// Note - This file is important, to ensure none of the non-imported modules are ignored
8+
// Particularly, sqlite3 module isn't imported directly anywhere, but is required by Sequelize
9+
// Hence, need to use here
10+
11+
export const sqlite3Version = sqlite3.VERSION;
12+
13+
console.log("Renderer Deps:", {
14+
electron,
15+
electronFs,
16+
electronOs,
17+
ipcRenderer,
18+
platform: electronOs.platform(),
19+
// remote,
20+
sqlite3,
21+
sqlite3Version,
22+
// remoteMain,
23+
});

0 commit comments

Comments
 (0)