sqlite-hub 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +12 -6
  2. package/changelog.md +12 -0
  3. package/{js → frontend/js}/api.js +7 -0
  4. package/{js → frontend/js}/app.js +87 -3
  5. package/{js → frontend/js}/components/connectionCard.js +8 -9
  6. package/frontend/js/components/connectionLogo.js +33 -0
  7. package/{js → frontend/js}/components/emptyState.js +25 -11
  8. package/{js → frontend/js}/components/modal.js +131 -0
  9. package/{js → frontend/js}/components/rowEditorPanel.js +63 -33
  10. package/{js → frontend/js}/components/sidebar.js +8 -3
  11. package/{js → frontend/js}/store.js +236 -1
  12. package/{js → frontend/js}/views/data.js +106 -9
  13. package/{js → frontend/js}/views/editor.js +4 -0
  14. package/{js → frontend/js}/views/structure.js +10 -12
  15. package/{styles → frontend/styles}/structure-graph.css +5 -10
  16. package/package.json +3 -3
  17. package/{publish_brew.sh → scripts/publish_brew.sh} +2 -2
  18. package/{publish_npm.sh → scripts/publish_npm.sh} +2 -2
  19. package/server/data/db_logos/.gitkeep +0 -0
  20. package/server/routes/connections.js +2 -0
  21. package/server/routes/data.js +14 -0
  22. package/server/server.js +29 -6
  23. package/server/services/sqlite/connectionManager.js +68 -33
  24. package/server/services/sqlite/dataBrowserService.js +30 -0
  25. package/server/services/storage/appStateStore.js +159 -20
  26. package/server/utils/appPaths.js +42 -18
  27. /package/{assets → frontend/assets}/images/logo.webp +0 -0
  28. /package/{assets → frontend/assets}/images/logo_extrasmall.webp +0 -0
  29. /package/{assets → frontend/assets}/images/logo_raw.png +0 -0
  30. /package/{assets → frontend/assets}/images/logo_small.webp +0 -0
  31. /package/{assets → frontend/assets}/mockups/connections.png +0 -0
  32. /package/{assets → frontend/assets}/mockups/data.png +0 -0
  33. /package/{assets → frontend/assets}/mockups/data_edit.png +0 -0
  34. /package/{assets → frontend/assets}/mockups/graph_visualize.png +0 -0
  35. /package/{assets → frontend/assets}/mockups/home.png +0 -0
  36. /package/{assets → frontend/assets}/mockups/overview.png +0 -0
  37. /package/{assets → frontend/assets}/mockups/sql_editor.png +0 -0
  38. /package/{assets → frontend/assets}/mockups/structure.png +0 -0
  39. /package/{index.html → frontend/index.html} +0 -0
  40. /package/{js → frontend/js}/components/actionBar.js +0 -0
  41. /package/{js → frontend/js}/components/appShell.js +0 -0
  42. /package/{js → frontend/js}/components/badges.js +0 -0
  43. /package/{js → frontend/js}/components/bottomTabs.js +0 -0
  44. /package/{js → frontend/js}/components/dataGrid.js +0 -0
  45. /package/{js → frontend/js}/components/metricCard.js +0 -0
  46. /package/{js → frontend/js}/components/pageHeader.js +0 -0
  47. /package/{js → frontend/js}/components/queryEditor.js +0 -0
  48. /package/{js → frontend/js}/components/queryResults.js +0 -0
  49. /package/{js → frontend/js}/components/statusBar.js +0 -0
  50. /package/{js → frontend/js}/components/structureGraph.js +0 -0
  51. /package/{js → frontend/js}/components/toast.js +0 -0
  52. /package/{js → frontend/js}/components/topNav.js +0 -0
  53. /package/{js → frontend/js}/lib/cytoscapeRuntime.js +0 -0
  54. /package/{js → frontend/js}/router.js +0 -0
  55. /package/{js → frontend/js}/utils/format.js +0 -0
  56. /package/{js → frontend/js}/views/connections.js +0 -0
  57. /package/{js → frontend/js}/views/landing.js +0 -0
  58. /package/{js → frontend/js}/views/overview.js +0 -0
  59. /package/{js → frontend/js}/views/settings.js +0 -0
  60. /package/{styles → frontend/styles}/base.css +0 -0
  61. /package/{styles → frontend/styles}/components.css +0 -0
  62. /package/{styles → frontend/styles}/layout.css +0 -0
  63. /package/{styles → frontend/styles}/tokens.css +0 -0
  64. /package/{styles → frontend/styles}/views.css +0 -0
  65. /package/{data → server/data}/.gitkeep +0 -0
@@ -6,6 +6,13 @@ const APP_NAME = "sqlite-hub";
6
6
  const APP_STATE_DB_FILENAME = "sqlite-hub-state.db";
7
7
  const LEGACY_STATE_FILENAME = "app-state.json";
8
8
 
9
+ function resolvePackagedDataDirectories(packageRoot) {
10
+ return [
11
+ path.resolve(packageRoot, "server", "data"),
12
+ path.resolve(packageRoot, "data"),
13
+ ].filter((candidatePath, index, candidates) => candidates.indexOf(candidatePath) === index);
14
+ }
15
+
9
16
  function resolveAppStateDirectory() {
10
17
  const homeDirectory = os.homedir();
11
18
 
@@ -28,7 +35,7 @@ function resolveAppStateDirectory() {
28
35
  }
29
36
 
30
37
  function resolvePackagedDataDirectory(packageRoot) {
31
- return path.resolve(packageRoot, "data");
38
+ return resolvePackagedDataDirectories(packageRoot)[0];
32
39
  }
33
40
 
34
41
  function resolvePackagedAppStateDbPath(packageRoot) {
@@ -36,7 +43,11 @@ function resolvePackagedAppStateDbPath(packageRoot) {
36
43
  }
37
44
 
38
45
  function resolvePackagedLegacyStatePath(packageRoot) {
39
- return path.join(resolvePackagedDataDirectory(packageRoot), LEGACY_STATE_FILENAME);
46
+ const candidates = resolvePackagedDataDirectories(packageRoot).map((directoryPath) =>
47
+ path.join(directoryPath, LEGACY_STATE_FILENAME)
48
+ );
49
+
50
+ return candidates.find((candidatePath) => fs.existsSync(candidatePath)) ?? candidates[0];
40
51
  }
41
52
 
42
53
  function resolveHomebrewCellarInfo(packageRoot) {
@@ -83,23 +94,34 @@ function collectHomebrewLegacyStateDbPaths(packageRoot) {
83
94
  return fs
84
95
  .readdirSync(cellarInfo.cellarRoot, { withFileTypes: true })
85
96
  .filter((entry) => entry.isDirectory() && entry.name !== cellarInfo.currentVersion)
86
- .map((entry) => {
87
- const candidatePath = path.join(
88
- cellarInfo.cellarRoot,
89
- entry.name,
90
- "libexec",
91
- "lib",
92
- "node_modules",
93
- APP_NAME,
94
- "data",
95
- APP_STATE_DB_FILENAME
96
- );
97
-
98
- return {
97
+ .flatMap((entry) =>
98
+ [
99
+ path.join(
100
+ cellarInfo.cellarRoot,
101
+ entry.name,
102
+ "libexec",
103
+ "lib",
104
+ "node_modules",
105
+ APP_NAME,
106
+ "server",
107
+ "data",
108
+ APP_STATE_DB_FILENAME
109
+ ),
110
+ path.join(
111
+ cellarInfo.cellarRoot,
112
+ entry.name,
113
+ "libexec",
114
+ "lib",
115
+ "node_modules",
116
+ APP_NAME,
117
+ "data",
118
+ APP_STATE_DB_FILENAME
119
+ ),
120
+ ].map((candidatePath) => ({
99
121
  path: candidatePath,
100
122
  mtimeMs: safeStatMtimeMs(candidatePath),
101
- };
102
- })
123
+ }))
124
+ )
103
125
  .filter((candidate) => candidate.mtimeMs >= 0)
104
126
  .sort((left, right) => right.mtimeMs - left.mtimeMs)
105
127
  .map((candidate) => candidate.path);
@@ -107,7 +129,9 @@ function collectHomebrewLegacyStateDbPaths(packageRoot) {
107
129
 
108
130
  function collectLegacyDatabasePaths(packageRoot) {
109
131
  return [
110
- resolvePackagedAppStateDbPath(packageRoot),
132
+ ...resolvePackagedDataDirectories(packageRoot).map((directoryPath) =>
133
+ path.join(directoryPath, APP_STATE_DB_FILENAME)
134
+ ),
111
135
  ...collectHomebrewLegacyStateDbPaths(packageRoot),
112
136
  ].filter((candidatePath, index, candidates) => candidates.indexOf(candidatePath) === index);
113
137
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes