browser-extension-manager 1.0.13 → 1.1.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 (242) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/CLAUDE.md +672 -0
  3. package/TODO.md +3 -0
  4. package/dist/assets/css/browser-extension-manager.scss +18 -0
  5. package/dist/assets/css/components/content/index.scss +5 -0
  6. package/dist/assets/css/components/options/index.scss +5 -0
  7. package/dist/assets/css/components/pages/index.scss +5 -0
  8. package/dist/assets/css/components/popup/index.scss +5 -0
  9. package/dist/assets/css/core/_animations.scss +64 -0
  10. package/dist/assets/css/core/_initialize.scss +23 -0
  11. package/dist/assets/css/core/_utilities.scss +80 -0
  12. package/dist/assets/themes/_template/_theme.js +5 -0
  13. package/dist/assets/themes/_template/_theme.scss +5 -0
  14. package/dist/assets/themes/bootstrap/_theme.js +16 -0
  15. package/dist/assets/themes/bootstrap/_theme.scss +232 -0
  16. package/dist/assets/themes/bootstrap/js/index.esm.js +19 -0
  17. package/dist/assets/themes/bootstrap/js/index.umd.js +34 -0
  18. package/dist/assets/themes/bootstrap/js/src/alert.js +87 -0
  19. package/dist/assets/themes/bootstrap/js/src/base-component.js +86 -0
  20. package/dist/assets/themes/bootstrap/js/src/button.js +72 -0
  21. package/dist/assets/themes/bootstrap/js/src/carousel.js +474 -0
  22. package/dist/assets/themes/bootstrap/js/src/collapse.js +297 -0
  23. package/dist/assets/themes/bootstrap/js/src/dom/data.js +55 -0
  24. package/dist/assets/themes/bootstrap/js/src/dom/event-handler.js +317 -0
  25. package/dist/assets/themes/bootstrap/js/src/dom/manipulator.js +71 -0
  26. package/dist/assets/themes/bootstrap/js/src/dom/selector-engine.js +126 -0
  27. package/dist/assets/themes/bootstrap/js/src/dropdown.js +458 -0
  28. package/dist/assets/themes/bootstrap/js/src/modal.js +378 -0
  29. package/dist/assets/themes/bootstrap/js/src/offcanvas.js +282 -0
  30. package/dist/assets/themes/bootstrap/js/src/popover.js +97 -0
  31. package/dist/assets/themes/bootstrap/js/src/scrollspy.js +296 -0
  32. package/dist/assets/themes/bootstrap/js/src/tab.js +315 -0
  33. package/dist/assets/themes/bootstrap/js/src/toast.js +224 -0
  34. package/dist/assets/themes/bootstrap/js/src/tooltip.js +632 -0
  35. package/dist/assets/themes/bootstrap/js/src/util/backdrop.js +151 -0
  36. package/dist/assets/themes/bootstrap/js/src/util/component-functions.js +35 -0
  37. package/dist/assets/themes/bootstrap/js/src/util/config.js +65 -0
  38. package/dist/assets/themes/bootstrap/js/src/util/focustrap.js +115 -0
  39. package/dist/assets/themes/bootstrap/js/src/util/index.js +306 -0
  40. package/dist/assets/themes/bootstrap/js/src/util/sanitizer.js +117 -0
  41. package/dist/assets/themes/bootstrap/js/src/util/scrollbar.js +114 -0
  42. package/dist/assets/themes/bootstrap/js/src/util/swipe.js +146 -0
  43. package/dist/assets/themes/bootstrap/js/src/util/template-factory.js +160 -0
  44. package/dist/assets/themes/bootstrap/scss/_accordion.scss +153 -0
  45. package/dist/assets/themes/bootstrap/scss/_alert.scss +68 -0
  46. package/dist/assets/themes/bootstrap/scss/_badge.scss +38 -0
  47. package/dist/assets/themes/bootstrap/scss/_breadcrumb.scss +40 -0
  48. package/dist/assets/themes/bootstrap/scss/_button-group.scss +147 -0
  49. package/dist/assets/themes/bootstrap/scss/_buttons.scss +216 -0
  50. package/dist/assets/themes/bootstrap/scss/_card.scss +238 -0
  51. package/dist/assets/themes/bootstrap/scss/_carousel.scss +226 -0
  52. package/dist/assets/themes/bootstrap/scss/_close.scss +66 -0
  53. package/dist/assets/themes/bootstrap/scss/_containers.scss +41 -0
  54. package/dist/assets/themes/bootstrap/scss/_dropdown.scss +250 -0
  55. package/dist/assets/themes/bootstrap/scss/_forms.scss +9 -0
  56. package/dist/assets/themes/bootstrap/scss/_functions.scss +302 -0
  57. package/dist/assets/themes/bootstrap/scss/_grid.scss +39 -0
  58. package/dist/assets/themes/bootstrap/scss/_helpers.scss +12 -0
  59. package/dist/assets/themes/bootstrap/scss/_images.scss +42 -0
  60. package/dist/assets/themes/bootstrap/scss/_list-group.scss +199 -0
  61. package/dist/assets/themes/bootstrap/scss/_maps.scss +174 -0
  62. package/dist/assets/themes/bootstrap/scss/_mixins.scss +42 -0
  63. package/dist/assets/themes/bootstrap/scss/_modal.scss +240 -0
  64. package/dist/assets/themes/bootstrap/scss/_nav.scss +197 -0
  65. package/dist/assets/themes/bootstrap/scss/_navbar.scss +289 -0
  66. package/dist/assets/themes/bootstrap/scss/_offcanvas.scss +147 -0
  67. package/dist/assets/themes/bootstrap/scss/_pagination.scss +109 -0
  68. package/dist/assets/themes/bootstrap/scss/_placeholders.scss +51 -0
  69. package/dist/assets/themes/bootstrap/scss/_popover.scss +196 -0
  70. package/dist/assets/themes/bootstrap/scss/_progress.scss +68 -0
  71. package/dist/assets/themes/bootstrap/scss/_reboot.scss +611 -0
  72. package/dist/assets/themes/bootstrap/scss/_root.scss +187 -0
  73. package/dist/assets/themes/bootstrap/scss/_spinners.scss +85 -0
  74. package/dist/assets/themes/bootstrap/scss/_tables.scss +171 -0
  75. package/dist/assets/themes/bootstrap/scss/_toasts.scss +73 -0
  76. package/dist/assets/themes/bootstrap/scss/_tooltip.scss +119 -0
  77. package/dist/assets/themes/bootstrap/scss/_transitions.scss +27 -0
  78. package/dist/assets/themes/bootstrap/scss/_type.scss +106 -0
  79. package/dist/assets/themes/bootstrap/scss/_utilities.scss +806 -0
  80. package/dist/assets/themes/bootstrap/scss/_variables-dark.scss +102 -0
  81. package/dist/assets/themes/bootstrap/scss/_variables.scss +1753 -0
  82. package/dist/assets/themes/bootstrap/scss/bootstrap-grid.scss +62 -0
  83. package/dist/assets/themes/bootstrap/scss/bootstrap-reboot.scss +10 -0
  84. package/dist/assets/themes/bootstrap/scss/bootstrap-utilities.scss +19 -0
  85. package/dist/assets/themes/bootstrap/scss/bootstrap.scss +52 -0
  86. package/dist/assets/themes/bootstrap/scss/forms/_floating-labels.scss +97 -0
  87. package/dist/assets/themes/bootstrap/scss/forms/_form-check.scss +189 -0
  88. package/dist/assets/themes/bootstrap/scss/forms/_form-control.scss +214 -0
  89. package/dist/assets/themes/bootstrap/scss/forms/_form-range.scss +91 -0
  90. package/dist/assets/themes/bootstrap/scss/forms/_form-select.scss +80 -0
  91. package/dist/assets/themes/bootstrap/scss/forms/_form-text.scss +11 -0
  92. package/dist/assets/themes/bootstrap/scss/forms/_input-group.scss +132 -0
  93. package/dist/assets/themes/bootstrap/scss/forms/_labels.scss +36 -0
  94. package/dist/assets/themes/bootstrap/scss/forms/_validation.scss +12 -0
  95. package/dist/assets/themes/bootstrap/scss/helpers/_clearfix.scss +3 -0
  96. package/dist/assets/themes/bootstrap/scss/helpers/_color-bg.scss +7 -0
  97. package/dist/assets/themes/bootstrap/scss/helpers/_colored-links.scss +30 -0
  98. package/dist/assets/themes/bootstrap/scss/helpers/_focus-ring.scss +5 -0
  99. package/dist/assets/themes/bootstrap/scss/helpers/_icon-link.scss +25 -0
  100. package/dist/assets/themes/bootstrap/scss/helpers/_position.scss +36 -0
  101. package/dist/assets/themes/bootstrap/scss/helpers/_ratio.scss +26 -0
  102. package/dist/assets/themes/bootstrap/scss/helpers/_stacks.scss +15 -0
  103. package/dist/assets/themes/bootstrap/scss/helpers/_stretched-link.scss +15 -0
  104. package/dist/assets/themes/bootstrap/scss/helpers/_text-truncation.scss +7 -0
  105. package/dist/assets/themes/bootstrap/scss/helpers/_visually-hidden.scss +8 -0
  106. package/dist/assets/themes/bootstrap/scss/helpers/_vr.scss +8 -0
  107. package/dist/assets/themes/bootstrap/scss/mixins/_alert.scss +18 -0
  108. package/dist/assets/themes/bootstrap/scss/mixins/_backdrop.scss +14 -0
  109. package/dist/assets/themes/bootstrap/scss/mixins/_banner.scss +7 -0
  110. package/dist/assets/themes/bootstrap/scss/mixins/_border-radius.scss +78 -0
  111. package/dist/assets/themes/bootstrap/scss/mixins/_box-shadow.scss +18 -0
  112. package/dist/assets/themes/bootstrap/scss/mixins/_breakpoints.scss +127 -0
  113. package/dist/assets/themes/bootstrap/scss/mixins/_buttons.scss +70 -0
  114. package/dist/assets/themes/bootstrap/scss/mixins/_caret.scss +69 -0
  115. package/dist/assets/themes/bootstrap/scss/mixins/_clearfix.scss +9 -0
  116. package/dist/assets/themes/bootstrap/scss/mixins/_color-mode.scss +21 -0
  117. package/dist/assets/themes/bootstrap/scss/mixins/_color-scheme.scss +7 -0
  118. package/dist/assets/themes/bootstrap/scss/mixins/_container.scss +11 -0
  119. package/dist/assets/themes/bootstrap/scss/mixins/_deprecate.scss +10 -0
  120. package/dist/assets/themes/bootstrap/scss/mixins/_forms.scss +163 -0
  121. package/dist/assets/themes/bootstrap/scss/mixins/_gradients.scss +47 -0
  122. package/dist/assets/themes/bootstrap/scss/mixins/_grid.scss +151 -0
  123. package/dist/assets/themes/bootstrap/scss/mixins/_image.scss +16 -0
  124. package/dist/assets/themes/bootstrap/scss/mixins/_list-group.scss +26 -0
  125. package/dist/assets/themes/bootstrap/scss/mixins/_lists.scss +7 -0
  126. package/dist/assets/themes/bootstrap/scss/mixins/_pagination.scss +10 -0
  127. package/dist/assets/themes/bootstrap/scss/mixins/_reset-text.scss +17 -0
  128. package/dist/assets/themes/bootstrap/scss/mixins/_resize.scss +6 -0
  129. package/dist/assets/themes/bootstrap/scss/mixins/_table-variants.scss +24 -0
  130. package/dist/assets/themes/bootstrap/scss/mixins/_text-truncate.scss +8 -0
  131. package/dist/assets/themes/bootstrap/scss/mixins/_transition.scss +26 -0
  132. package/dist/assets/themes/bootstrap/scss/mixins/_utilities.scss +97 -0
  133. package/dist/assets/themes/bootstrap/scss/mixins/_visually-hidden.scss +38 -0
  134. package/dist/assets/themes/bootstrap/scss/tests/jasmine.js +16 -0
  135. package/dist/assets/themes/bootstrap/scss/tests/mixins/_auto-import-of-variables-dark.test.scss +7 -0
  136. package/dist/assets/themes/bootstrap/scss/tests/mixins/_color-modes.test.scss +69 -0
  137. package/dist/assets/themes/bootstrap/scss/tests/mixins/_media-query-color-mode-full.test.scss +8 -0
  138. package/dist/assets/themes/bootstrap/scss/tests/mixins/_utilities.test.scss +393 -0
  139. package/dist/assets/themes/bootstrap/scss/tests/sass-true/register.js +14 -0
  140. package/dist/assets/themes/bootstrap/scss/tests/sass-true/runner.js +17 -0
  141. package/dist/assets/themes/bootstrap/scss/tests/utilities/_api.test.scss +75 -0
  142. package/dist/assets/themes/bootstrap/scss/utilities/_api.scss +47 -0
  143. package/dist/assets/themes/bootstrap/scss/vendor/_rfs.scss +348 -0
  144. package/dist/assets/themes/classy/README.md +75 -0
  145. package/dist/assets/themes/classy/_config.scss +185 -0
  146. package/dist/assets/themes/classy/_theme.js +29 -0
  147. package/dist/assets/themes/classy/_theme.scss +34 -0
  148. package/dist/assets/themes/classy/css/base/_animations.scss +27 -0
  149. package/dist/assets/themes/classy/css/base/_backgrounds.scss +191 -0
  150. package/dist/assets/themes/classy/css/base/_borders.scss +65 -0
  151. package/dist/assets/themes/classy/css/base/_root.scss +58 -0
  152. package/dist/assets/themes/classy/css/base/_soft-colors.scss +92 -0
  153. package/dist/assets/themes/classy/css/base/_spacing.scss +64 -0
  154. package/dist/assets/themes/classy/css/base/_typography.scss +179 -0
  155. package/dist/assets/themes/classy/css/base/_utilities.scss +77 -0
  156. package/dist/assets/themes/classy/css/components/_accordion.scss +33 -0
  157. package/dist/assets/themes/classy/css/components/_avatars.scss +32 -0
  158. package/dist/assets/themes/classy/css/components/_badges.scss +25 -0
  159. package/dist/assets/themes/classy/css/components/_buttons.scss +397 -0
  160. package/dist/assets/themes/classy/css/components/_cards.scss +33 -0
  161. package/dist/assets/themes/classy/css/components/_carousel.scss +41 -0
  162. package/dist/assets/themes/classy/css/components/_forms.scss +115 -0
  163. package/dist/assets/themes/classy/css/components/_links.scss +19 -0
  164. package/dist/assets/themes/classy/css/components/_logo-scroll.scss +57 -0
  165. package/dist/assets/themes/classy/css/components/_spinners.scss +19 -0
  166. package/dist/assets/themes/classy/css/components/_text.scss +41 -0
  167. package/dist/assets/themes/classy/css/layout/_blog.scss +42 -0
  168. package/dist/assets/themes/classy/css/layout/_general.scss +139 -0
  169. package/dist/assets/themes/classy/css/layout/_navigation.scss +576 -0
  170. package/dist/assets/themes/classy/css/layout/_team.scss +18 -0
  171. package/dist/assets/themes/classy/js/logo-scroll.js +83 -0
  172. package/dist/assets/themes/classy/js/navbar-scroll.js +65 -0
  173. package/dist/background.js +236 -260
  174. package/dist/build.js +93 -4
  175. package/dist/commands/setup.js +0 -268
  176. package/dist/config/manifest.json +11 -3
  177. package/dist/config/page-template.html +21 -0
  178. package/dist/defaults/.nvmrc +1 -1
  179. package/dist/defaults/CLAUDE.md +8 -0
  180. package/dist/defaults/config/browser-extension-manager.json +37 -0
  181. package/dist/defaults/src/assets/css/components/content/index.scss +11 -0
  182. package/dist/defaults/src/assets/css/components/options/index.scss +14 -0
  183. package/dist/defaults/src/assets/css/components/pages/index.scss +10 -0
  184. package/dist/defaults/src/assets/css/components/popup/index.scss +10 -0
  185. package/dist/defaults/src/assets/css/components/sidepanel/index.scss +6 -0
  186. package/dist/defaults/src/assets/css/main.scss +32 -0
  187. package/dist/defaults/src/assets/js/components/background/index.js +22 -0
  188. package/dist/defaults/src/assets/js/components/content/index.js +22 -0
  189. package/dist/defaults/src/assets/js/components/options/index.js +22 -0
  190. package/dist/defaults/src/assets/js/components/pages/index.js +22 -0
  191. package/dist/defaults/src/assets/js/components/popup/index.js +22 -0
  192. package/dist/defaults/src/assets/js/components/sidepanel/index.js +20 -0
  193. package/dist/defaults/src/assets/vendor/.gitkeep +0 -0
  194. package/dist/defaults/src/manifest.json +11 -6
  195. package/dist/defaults/src/views/options/index.html +8 -0
  196. package/dist/defaults/src/views/pages/index.html +10 -0
  197. package/dist/defaults/src/views/popup/index.html +4 -0
  198. package/dist/defaults/src/views/sidepanel/index.html +4 -0
  199. package/dist/gulp/main.js +11 -5
  200. package/dist/gulp/plugins/webpack/strip-dev-blocks.js +53 -0
  201. package/dist/gulp/tasks/{_package.js → BU/_package.js} +1 -1
  202. package/dist/gulp/tasks/{developmentRebuild.js → BU/developmentRebuild.js} +1 -1
  203. package/dist/gulp/tasks/{themes.js → BU/themes.js} +3 -2
  204. package/dist/gulp/tasks/{test.js → _.js} +3 -3
  205. package/dist/gulp/tasks/audit.js +154 -0
  206. package/dist/gulp/tasks/defaults.js +308 -0
  207. package/dist/gulp/tasks/distribute.js +87 -92
  208. package/dist/gulp/tasks/html.js +150 -0
  209. package/dist/gulp/tasks/icons.js +3 -2
  210. package/dist/gulp/tasks/package.js +216 -27
  211. package/dist/gulp/tasks/sass.js +188 -43
  212. package/dist/gulp/tasks/serve.js +1 -0
  213. package/dist/gulp/tasks/utils/template-transform.js +50 -0
  214. package/dist/gulp/tasks/webpack.js +338 -134
  215. package/dist/index.js +34 -34
  216. package/dist/options.js +40 -0
  217. package/dist/page.js +40 -0
  218. package/dist/popup.js +40 -0
  219. package/dist/sidepanel.js +40 -0
  220. package/firebase-debug.log +322 -0
  221. package/package.json +25 -18
  222. package/dist/assets/css/main.scss +0 -3
  223. package/dist/assets/themes/bootstrap/5.3.3/css/bootstrap.css +0 -12057
  224. package/dist/assets/themes/bootstrap/5.3.3/css/bootstrap.css.map +0 -1
  225. package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.bundle.js +0 -6314
  226. package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.bundle.js.map +0 -1
  227. package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.js +0 -4494
  228. package/dist/assets/themes/bootstrap/5.3.3/js/bootstrap.js.map +0 -1
  229. package/dist/defaults/src/assets/css/content.scss +0 -2
  230. package/dist/defaults/src/assets/css/options.scss +0 -11
  231. package/dist/defaults/src/assets/css/popup.scss +0 -14
  232. package/dist/defaults/src/assets/js/background.js +0 -18
  233. package/dist/defaults/src/assets/js/content.js +0 -15
  234. package/dist/defaults/src/assets/js/options.js +0 -17
  235. package/dist/defaults/src/assets/js/popup.js +0 -17
  236. package/dist/defaults/src/pages/options.html +0 -26
  237. package/dist/defaults/src/pages/popup.html +0 -26
  238. /package/dist/{defaults/src/assets/images/_ → assets/css/bundles/.gitkeep} +0 -0
  239. /package/dist/assets/css/{fontawesome.scss → core/_fontawesome.scss} +0 -0
  240. /package/dist/defaults/src/assets/{vendor/_ → images/.gitkeep} +0 -0
  241. /package/dist/gulp/tasks/{_importer.js → BU/_importer.js} +0 -0
  242. /package/dist/gulp/tasks/{_vendor.js → BU/_vendor.js} +0 -0
package/dist/build.js CHANGED
@@ -1,9 +1,10 @@
1
1
  // Libraries
2
2
  const path = require('path');
3
3
  const jetpack = require('fs-jetpack');
4
+ const fs = require('fs');
4
5
  const JSON5 = require('json5');
5
6
  const argv = require('yargs').argv;
6
- const { force } = require('node-powertools');
7
+ const { force, execute } = require('node-powertools');
7
8
 
8
9
  // Class
9
10
  function Manager() {
@@ -23,7 +24,13 @@ Manager.prototype.initialize = function () {
23
24
 
24
25
  // Logger
25
26
  Manager.prototype.logger = function (name) {
26
- // Create logger
27
+ // Check if called as static method (this is not a Manager instance)
28
+ if (!(this instanceof Manager)) {
29
+ // For static calls, just return a new logger without caching
30
+ return new (require('./lib/logger'))(name);
31
+ }
32
+
33
+ // For instance calls, cache the logger
27
34
  if (!this._logger) {
28
35
  this._logger = new (require('./lib/logger'))(name);
29
36
  }
@@ -45,12 +52,44 @@ Manager.getArguments = function () {
45
52
  };
46
53
  Manager.prototype.getArguments = Manager.getArguments;
47
54
 
55
+ // Report build errors with notification
56
+ Manager.reportBuildError = function (error, callback) {
57
+ const logger = new (require('./lib/logger'))('build-error');
58
+
59
+ // Send notification using notifly
60
+ const errorMessage = error.message || error.toString() || 'Unknown error';
61
+ const errorPlugin = error.plugin || 'Build';
62
+
63
+ execute(`notifly --title 'Build Error: ${errorPlugin}' --message '${errorMessage.replace(/'/g, "\\'")}' --appIcon '/Users/ian/claude-ai-icon.png' --timeout 3 --sound 'Sosumi'`)
64
+ .catch((e) => {
65
+ logger.error('Failed to send notification', e);
66
+ });
67
+
68
+ // Log the error
69
+ logger.error(`[${errorPlugin}] ${errorMessage}`);
70
+
71
+ // If callback provided, call it with error
72
+ if (callback) {
73
+ return callback(error);
74
+ }
75
+
76
+ // Otherwise return a function that calls the callback with error
77
+ return (cb) => cb ? cb(error) : error;
78
+ };
79
+ Manager.prototype.reportBuildError = Manager.reportBuildError;
80
+
48
81
  // isBuildMode: checks if the build mode is enabled
49
82
  Manager.isBuildMode = function () {
50
83
  return process.env.BXM_BUILD_MODE === 'true';
51
84
  }
52
85
  Manager.prototype.isBuildMode = Manager.isBuildMode;
53
86
 
87
+ // actLikeProduction - determines if we should act like production mode
88
+ Manager.actLikeProduction = function () {
89
+ return Boolean(Manager.isBuildMode() || process.env.UJ_AUDIT_FORCE === 'true');
90
+ }
91
+ Manager.prototype.actLikeProduction = Manager.actLikeProduction;
92
+
54
93
  // getEnvironment: returns the environment based on the build mode
55
94
  Manager.getEnvironment = function () {
56
95
  return Manager.isBuildMode()
@@ -65,9 +104,9 @@ Manager.getManifest = function () {
65
104
  }
66
105
  Manager.prototype.getManifest = Manager.getManifest;
67
106
 
68
- // getConfig: requires and parses config.json
107
+ // getConfig: requires and parses browser-extension-manager.json
69
108
  Manager.getConfig = function () {
70
- return JSON5.parse(jetpack.read(path.join(process.cwd(), 'config', 'config.json')));
109
+ return JSON5.parse(jetpack.read(path.join(process.cwd(), 'config', 'browser-extension-manager.json')));
71
110
  }
72
111
  Manager.prototype.getConfig = Manager.getConfig;
73
112
 
@@ -100,11 +139,61 @@ Manager.getLiveReloadPort = function () {
100
139
  }
101
140
  Manager.prototype.getLiveReloadPort = Manager.getLiveReloadPort;
102
141
 
142
+ // Create dummy file in project dist to force jekyll to build
143
+ Manager.triggerRebuild = function (files, logger) {
144
+ // Ensure logger is defined
145
+ logger = this?._logger || logger || console;
146
+
147
+ // Normalize files into an array of file names
148
+ if (typeof files === 'string') {
149
+ files = [files]; // Single string file name
150
+ } else if (Array.isArray(files)) {
151
+ // Already an array, no changes needed
152
+ } else if (typeof files === 'object' && files !== null) {
153
+ files = Object.keys(files); // Extract keys from object
154
+ } else {
155
+ logger.error('Invalid files for triggerRebuild()');
156
+ return;
157
+ }
158
+
159
+ // Set current time
160
+ const now = new Date();
161
+
162
+ // Touch all files to update mtime (so Jekyll notices)
163
+ files.forEach((file) => {
164
+ try {
165
+ fs.utimesSync(file, now, now);
166
+ logger.log(`Triggered build: ${file}`);
167
+ } catch (e) {
168
+ logger.error(`Failed to trigger build ${file}`, e);
169
+ }
170
+ });
171
+ }
172
+ Manager.prototype.triggerRebuild = Manager.triggerRebuild;
173
+
103
174
  // Require
104
175
  Manager.require = function (path) {
105
176
  return require(path);
106
177
  };
107
178
  Manager.prototype.require = Manager.require;
108
179
 
180
+ // Memory monitoring utility
181
+ Manager.getMemoryUsage = function () {
182
+ const used = process.memoryUsage();
183
+ return {
184
+ rss: Math.round(used.rss / 1024 / 1024),
185
+ heapTotal: Math.round(used.heapTotal / 1024 / 1024),
186
+ heapUsed: Math.round(used.heapUsed / 1024 / 1024),
187
+ external: Math.round(used.external / 1024 / 1024),
188
+ };
189
+ };
190
+ Manager.prototype.getMemoryUsage = Manager.getMemoryUsage;
191
+
192
+ Manager.logMemory = function (logger, label) {
193
+ const mem = Manager.getMemoryUsage();
194
+ logger.log(`[Memory ${label}] RSS: ${mem.rss}MB | Heap Used: ${mem.heapUsed}MB / ${mem.heapTotal}MB | External: ${mem.external}MB`);
195
+ };
196
+ Manager.prototype.logMemory = Manager.logMemory;
197
+
109
198
  // Export
110
199
  module.exports = Manager;
@@ -15,58 +15,11 @@ const package = Manager.getPackage('main');
15
15
  const project = Manager.getPackage('project');
16
16
  const manifest = Manager.getManifest();
17
17
 
18
- // Load config
19
- const templating = {
20
- nodeVersion: version.major(package.engines.node),
21
- };
22
-
23
18
  // Dependency MAP
24
19
  const DEPENDENCY_MAP = {
25
20
  'gulp': 'dev',
26
21
  }
27
22
 
28
- // File MAP
29
- const FILE_MAP = {
30
- // Files to skip overwrite
31
- 'hooks/**/*': {
32
- overwrite: false,
33
- },
34
- 'src/**/*': {
35
- overwrite: false,
36
- },
37
- 'src/**/*.{html,md}': {
38
- skip: (file) => {
39
- // Get the name
40
- const name = path.basename(file.name, path.extname(file.name));
41
- const htmlFilePath = path.join(file.destination, `${name}.html`);
42
- const mdFilePath = path.join(file.destination, `${name}.md`);
43
- const htmlFileExists = jetpack.exists(htmlFilePath);
44
- const mdFileExists = jetpack.exists(mdFilePath);
45
- const eitherExists = htmlFileExists || mdFileExists;
46
-
47
- // Skip if both files exist
48
- return eitherExists;
49
- },
50
- },
51
-
52
- // Files to rewrite path
53
- // Removed because getting too confusing
54
- // 'dist/pages/**/*': {
55
- // path: (file) => file.source.replace('dist/pages', 'dist'),
56
- // },
57
- '_.gitignore': {
58
- name: (file) => file.name.replace('_.gitignore', '.gitignore'),
59
- },
60
-
61
- // Files to run templating on
62
- '.github/workflows/build.yml': {
63
- template: templating,
64
- },
65
- '.nvmrc': {
66
- template: templating,
67
- },
68
- }
69
-
70
23
  module.exports = async function (options) {
71
24
  // Fix options
72
25
  options = options || {};
@@ -74,8 +27,6 @@ module.exports = async function (options) {
74
27
  options.checkNode = force(options.checkNode || true, 'boolean');
75
28
  options.checkPeerDependencies = force(options.checkPeerDependencies || true, 'boolean');
76
29
  options.setupScripts = force(options.setupScripts || true, 'boolean');
77
- options.buildSiteFiles = force(options.buildSiteFiles || true, 'boolean');
78
- options.buildSiteFilesInput = force(options.buildSiteFilesInput || ['**/*'], 'array');
79
30
  options.checkLocality = force(options.checkLocality || true, 'boolean');
80
31
 
81
32
  // Log
@@ -110,11 +61,6 @@ module.exports = async function (options) {
110
61
  await setupScripts();
111
62
  }
112
63
 
113
- // Build files
114
- if (options.buildSiteFiles) {
115
- await buildSiteFiles({ input: options.buildSiteFilesInput });
116
- }
117
-
118
64
  // Copy all files from src/defaults/dist on first run
119
65
  // await copyDefaultDistFiles();
120
66
 
@@ -259,220 +205,6 @@ function install(package, ver, location) {
259
205
  });
260
206
  }
261
207
 
262
- function buildSiteFiles(options) {
263
- options = options || {};
264
- options.input = options.input || ['**/*'];
265
-
266
- // Loop through all files in /defaults directory
267
- const dir = path.join(__dirname, '..', 'defaults');
268
- const input = [
269
- // Files to include
270
- // '**/*',
271
- ...options.input,
272
-
273
- // Files to exclude
274
- // Dist files
275
- // '!dist/**',
276
- '!**/.DS_Store', // TODO: NOT WORKING
277
- ]
278
-
279
- // Get all files
280
- const files = glob(input, {
281
- cwd: dir,
282
- dot: true,
283
- nodir: true,
284
- });
285
-
286
- const debug = argv.debug
287
- || true;
288
-
289
- // Log
290
- logger.log(`Preparing to copy ${files.length} default files...`);
291
-
292
- // Loop
293
- for (const file of files) {
294
- // Build item
295
- const item = {
296
- source: null,
297
- destination: null,
298
- name: null,
299
- }
300
- // Get the destination
301
- // const source = path.join(dir, file);
302
- // let destination = path.join(process.cwd(), file.replace('defaults/', ''));
303
- // const filename = path.basename(destination);
304
-
305
- // Set the item properties
306
- item.source = path.dirname(path.join(dir, file));
307
- item.name = path.basename(file);
308
- item.destination = path.dirname(path.join(process.cwd(), file.replace('defaults/', '')));
309
-
310
- // Get options
311
- const options = getFileOptions(file);
312
- const ogName = item.name;
313
-
314
- // Quit if file is '_'
315
- // We have files like this to trigger the creation of directories without them being ignored by git
316
- if (item.name === '_') {
317
- // First, create the directory around the file
318
- jetpack.dir(item.destination);
319
-
320
- // Skip
321
- continue;
322
- }
323
-
324
- // Resolve name
325
- if (typeof options.name === 'function') {
326
- item.name = options.name(item);
327
- }
328
-
329
- // Resolve path
330
- if (typeof options.path === 'function') {
331
- item.destination = options.path(item);
332
- }
333
-
334
- // Resolve overwrite
335
- if (typeof options.overwrite === 'function') {
336
- options.overwrite = options.overwrite(item);
337
- }
338
-
339
- // Resolve skip
340
- if (typeof options.skip === 'function') {
341
- options.skip = options.skip(item);
342
- }
343
-
344
- // Log
345
- if (debug) {
346
- logger.log(`Copying defaults...`);
347
- logger.log(` name: ${item.name}`);
348
- logger.log(` from: ${item.source}`);
349
- logger.log(` to: ${item.destination}`);
350
- logger.log(` overwrite: ${options.overwrite}`);
351
- logger.log(` skip: ${options.skip}`);
352
-
353
- // logger.log('File:', file);
354
- // logger.log('filename:', filename);
355
- // logger.log('options:', options);
356
- // // logger.log('contents:', jetpack.read(source));
357
- // logger.log('source:', source);
358
- // logger.log('Destination:', destination);
359
- console.log('\n');
360
- }
361
-
362
- // Skip if needed
363
- if (options.skip) {
364
- continue;
365
- }
366
-
367
- // Get final paths
368
- const finalSource = path.join(item.source, ogName);
369
- const finalDestination = path.join(item.destination, item.name);
370
-
371
- // console.log('---finalSource', finalSource);
372
- // console.log('---finalDestination', finalDestination);
373
-
374
- // Check if the file exists
375
- const exists = jetpack.exists(finalDestination);
376
-
377
- // Skip if exists and we don't want to overwrite
378
- if (!options.overwrite && exists) {
379
- continue;
380
- }
381
-
382
- // Run templating if needed
383
- if (options.template) {
384
- // Log
385
- // logger.log('Running templating on:', destination);
386
-
387
- // Run the templating
388
- const contents = jetpack.read(finalSource);
389
- const templated = template(contents, options.template);
390
-
391
- // Write the file
392
- jetpack.write(finalDestination, templated);
393
- } else {
394
- // Copy the file
395
- jetpack.copy(finalSource, finalDestination, { overwrite: true });
396
- }
397
- }
398
- }
399
-
400
- // Copy default dist files
401
- // async function copyDefaultDistFiles() {
402
- // // Get the directory
403
- // const dir = path.join(__dirname, '..', '..', 'defaults', 'dist');
404
-
405
- // // Log
406
- // logger.log(`Copying default dist files from ${dir}`);
407
-
408
- // // Copy the files
409
- // jetpack.copy(dir, 'dist', { overwrite: true });
410
- // }
411
- // async function copyDefaultDistFiles() {
412
- // // Loop through all files in /defaults directory
413
- // const dir = path.join(__dirname, '..', '..', 'defaults', 'dist');
414
- // const input = [
415
- // // Files to include
416
- // '**/*',
417
-
418
- // // Files to exclude
419
- // '!**/.DS_Store', // TODO: NOT WORKING
420
- // ]
421
-
422
- // // Get all files
423
- // const files = glob(input, {
424
- // cwd: dir,
425
- // dot: true,
426
- // nodir: true,
427
- // });
428
-
429
- // // Log
430
- // logger.log(`Preparing to copy ${files.length} default dist files...`);
431
-
432
- // for (const file of files) {
433
- // // const relativePath = path.relative(path.join(__dirname, '..', '..', 'defaults', 'dist'), file);
434
- // // const destination = path.join(__dirname, '..', '..', 'dist', relativePath.replace('pages', ''));
435
- // const source = path.join(dir, file);
436
- // const destination = path.join(process.cwd(), file.replace('dist/pages', 'dist'));
437
-
438
- // // Log
439
- // if (true) {
440
- // logger.log(`Copying default dist file...`);
441
- // logger.log(` file: ${file}`);
442
- // logger.log(` from: ${source}`);
443
- // logger.log(` to: ${destination}`);
444
- // console.log('\n');
445
- // }
446
-
447
- // // Ensure the directory exists
448
- // // await jetpack.dir(path.dirname(destination));
449
-
450
- // // Copy the file
451
- // // await jetpack.copy(file, destination, { overwrite: true });
452
- // }
453
- // }
454
-
455
- function getFileOptions(filePath) {
456
- const defaults = {
457
- overwrite: true,
458
- name: null,
459
- path: null,
460
- template: null,
461
- skip: false,
462
- };
463
-
464
- let options = { ...defaults };
465
-
466
- // Loop through all patterns
467
- for (const pattern in FILE_MAP) {
468
- if (minimatch(filePath, pattern)) {
469
- options = { ...options, ...FILE_MAP[pattern] };
470
- }
471
- }
472
-
473
- return options;
474
- }
475
-
476
208
  function logVersionCheck(name, installedVersion, latestVersion, isUpToDate) {
477
209
  // Quit if local
478
210
  if (installedVersion.startsWith('file:')) {
@@ -10,8 +10,10 @@
10
10
  '512': 'assets/images/icons/icon-512x.png',
11
11
  '256': 'assets/images/icons/icon-256x.png',
12
12
  '128': 'assets/images/icons/icon-128x.png',
13
+ '64': 'assets/images/icons/icon-64x.png',
13
14
  '48': 'assets/images/icons/icon-48x.png',
14
15
  '32': 'assets/images/icons/icon-32x.png',
16
+ '24': 'assets/images/icons/icon-24x.png',
15
17
  '16': 'assets/images/icons/icon-16x.png',
16
18
  },
17
19
 
@@ -20,7 +22,7 @@
20
22
 
21
23
  // Background script
22
24
  background: {
23
- service_worker: 'assets/js/background.bundle.js',
25
+ service_worker: 'assets/js/components/background.bundle.js',
24
26
  },
25
27
 
26
28
  // Permissions
@@ -31,7 +33,7 @@
31
33
 
32
34
  // Options page
33
35
  options_ui: {
34
- page: 'pages/options.html',
36
+ page: 'views/options/index.html',
35
37
  },
36
38
 
37
39
  // Content scripts
@@ -43,10 +45,16 @@
43
45
  default_icon: {
44
46
  '48': 'assets/images/icons/icon-48x.png',
45
47
  '32': 'assets/images/icons/icon-32x.png',
48
+ '24': 'assets/images/icons/icon-24x.png',
46
49
  '16': 'assets/images/icons/icon-16x.png',
47
50
  },
48
51
  default_title: '__MSG_appName__',
49
- default_popup: 'pages/popup.html',
52
+ // default_popup: '', // Disabled so we can customize what happens on click
53
+ },
54
+
55
+ // Side panel
56
+ side_panel: {
57
+ default_path: 'views/sidepanel/index.html',
50
58
  },
51
59
 
52
60
  // Content security policy
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <html data-bs-theme="{{ theme.appearance }}">
3
+ <head>
4
+ <!-- Meta -->
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
7
+ <title>{{ page.title }}</title>
8
+
9
+ <!-- Main CSS (includes Font Awesome) -->
10
+ <link href="/assets/css/main.bundle.css" rel="stylesheet">
11
+
12
+ <!-- Component-specific CSS -->
13
+ <link href="/assets/css/components/{{ page.name }}.bundle.css" rel="stylesheet">
14
+ </head>
15
+ <body>
16
+ {{ content }}
17
+
18
+ <!-- Main JS -->
19
+ <script src="/assets/js/components/{{ page.name }}.bundle.js"></script>
20
+ </body>
21
+ </html>
@@ -1 +1 @@
1
- v{nodeVersion}/*
1
+ v{ versions.node }/*
@@ -0,0 +1,8 @@
1
+ # Identity
2
+ This is a browser extension that is "consuming" a browser extension template project called Browser Extension Manager (BEM)--a collection of components that can be used to build a browser extension quickly and efficiently.
3
+
4
+ ## BEM Documentation
5
+ You should have a full understanding of Browser Extension Manager before editing this project, which can be found at: node_modules/browser-extension-manager/CLAUDE.md
6
+
7
+ ## Project-specific Notes
8
+ Add any notes specific to this project here.
@@ -0,0 +1,37 @@
1
+ {
2
+ app: {
3
+ id: 'ultimate-jekyll',
4
+ },
5
+ theme: {
6
+ id: 'classy',
7
+ },
8
+ brand: {
9
+ name: 'Ultimate Jekyll',
10
+ url: 'https://ultimate-jekyll.itwcreativeworks.com',
11
+ contact: {
12
+ email: 'support@itwcreativeworks.com',
13
+ },
14
+ images: {
15
+ brandmark: 'https://cdn.itwcreativeworks.com/assets/itw-creative-works/images/logo/itw-creative-works-brandmark-blue-1024x1024.png',
16
+ wordmark: 'https://cdn.itwcreativeworks.com/assets/itw-creative-works/images/logo/itw-creative-works-wordmark-blue-1024x.png',
17
+ combomark: 'https://cdn.itwcreativeworks.com/assets/itw-creative-works/images/logo/itw-creative-works-combomark-blue-1024x.png',
18
+ },
19
+ },
20
+ sentry: {
21
+ dsn: '',
22
+ },
23
+ google_analytics: {
24
+ id: '',
25
+ secret: '',
26
+ },
27
+ firebaseConfig: {
28
+ apiKey: 'AIzaSyDzy5BG9-i9RmymyFx6mfwSgaRioyfa0Cc',
29
+ authDomain: 'ultimate-jekyll.itwcreativeworks.com',
30
+ databaseURL: 'https://ultimate-jekyll.firebaseio.com',
31
+ projectId: 'ultimate-jekyll',
32
+ storageBucket: 'ultimate-jekyll.appspot.com',
33
+ messagingSenderId: '837186164890',
34
+ appId: '1:837186164890:web:f1f59569d661078c',
35
+ measurementId: 'G-FR3X7X4KYN',
36
+ },
37
+ }
@@ -0,0 +1,11 @@
1
+ // ============================================
2
+ // Content Script Component
3
+ // ============================================
4
+
5
+ // Import default content script component styles
6
+ @use 'components/content' as *;
7
+
8
+ // ============================================
9
+ // Custom Content Script Styles
10
+ // ============================================
11
+ // Add your project-specific content script CSS below...
@@ -0,0 +1,14 @@
1
+ // ============================================
2
+ // Custom Options Component Override
3
+ // ============================================
4
+
5
+ // Import the default options component styles first
6
+ @use 'components/options' as *;
7
+
8
+ // ============================================
9
+ // Project-Specific Options Customization
10
+ // ============================================
11
+ body {
12
+ min-width: 400px;
13
+ max-width: 100%;
14
+ }
@@ -0,0 +1,10 @@
1
+ // ============================================
2
+ // Index Page (Main Extension Page)
3
+ // ============================================
4
+
5
+ // Import the default index page component styles first
6
+ @use 'components/pages/index' as *;
7
+
8
+ // ============================================
9
+ // Project-Specific Index Page Customization
10
+ // ============================================
@@ -0,0 +1,10 @@
1
+ // ============================================
2
+ // Custom Popup Component Override
3
+ // ============================================
4
+
5
+ // Import the default popup component styles first
6
+ @use 'components/popup' as *;
7
+
8
+ // ============================================
9
+ // Project-Specific Popup Customization
10
+ // ============================================
@@ -0,0 +1,6 @@
1
+ // ============================================
2
+ // Sidepanel Component Styles
3
+ // ============================================
4
+ // Default styles for the sidepanel view
5
+
6
+ // Add your sidepanel-specific styles here
@@ -0,0 +1,32 @@
1
+ // ============================================
2
+ // Theme Configuration
3
+ // ============================================
4
+
5
+ // Customize Browser Extension Manager theme variables here
6
+ @use 'browser-extension-manager' as * with (
7
+ // ============================================
8
+ // Brand Colors
9
+ // ============================================
10
+ $primary: #5B47FB,
11
+ // $secondary: #6C757D,
12
+
13
+ // ============================================
14
+ // Typography (uncomment to customize)
15
+ // ============================================
16
+ // $font-family-base: 'Inter', -apple-system, sans-serif,
17
+
18
+ // ============================================
19
+ // Borders (uncomment to customize)
20
+ // ============================================
21
+ // $border-radius: 0.5rem,
22
+
23
+ // ============================================
24
+ // Add more customizations below
25
+ // See theme.scss for all customizable variables
26
+ // ============================================
27
+ );
28
+
29
+ // ============================================
30
+ // Custom Global Styles
31
+ // ============================================
32
+ // Add your project-specific global CSS below that applies everywhere...
@@ -0,0 +1,22 @@
1
+ // ============================================
2
+ // Background Component (Service Worker)
3
+ // ============================================
4
+
5
+ // Import Browser Extension Manager
6
+ import Manager from 'browser-extension-manager/background';
7
+
8
+ // Create instance
9
+ const manager = new Manager();
10
+
11
+ // Initialize
12
+ manager.initialize()
13
+ .then(() => {
14
+ // Shortcuts
15
+ const { extension, logger, webManager } = manager;
16
+
17
+ // Add your project-specific background logic here
18
+ // ...
19
+
20
+ // Log the initialization
21
+ logger.log('Background initialized!');
22
+ });