browser-extension-manager 1.3.47 → 1.3.49

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.
@@ -2,7 +2,7 @@
2
2
  const Manager = new (require('../../build.js'));
3
3
  const logger = Manager.logger('defaults');
4
4
  const { src, dest, watch, series } = require('gulp');
5
- const through2 = require('through2');
5
+ const { Transform } = require('node:stream');
6
6
  const jetpack = require('fs-jetpack');
7
7
  const path = require('path');
8
8
  const { minimatch } = require('minimatch');
@@ -347,7 +347,9 @@ function defaults(complete, changedFile) {
347
347
  }
348
348
 
349
349
  function customTransform() {
350
- return through2.obj(function (file, _, callback) {
350
+ return new Transform({
351
+ objectMode: true,
352
+ transform(file, _, callback) {
351
353
  // Skip if it's a directory
352
354
  if (file.isDirectory()) {
353
355
  return callback(null, file);
@@ -477,6 +479,7 @@ function customTransform() {
477
479
 
478
480
  // Complete
479
481
  return callback();
482
+ },
480
483
  });
481
484
  }
482
485
  function defaultsWatcher(complete) {
@@ -2,7 +2,7 @@
2
2
  const Manager = new (require('../../build.js'));
3
3
  const logger = Manager.logger('distribute');
4
4
  const { src, dest, watch, series } = require('gulp');
5
- const through2 = require('through2');
5
+ const { Transform } = require('node:stream');
6
6
  const path = require('path');
7
7
  const jetpack = require('fs-jetpack');
8
8
  const createTemplateTransform = require('./utils/template-transform');
@@ -101,38 +101,41 @@ function distribute() {
101
101
  }
102
102
 
103
103
  function customTransform() {
104
- return through2.obj(function (file, _, callback) {
105
- // Skip if it's a directory
106
- if (file.isDirectory()) {
107
- return callback(null, file);
108
- }
109
-
110
- // Get relative path from src base
111
- const relativePath = path.relative(file.base, file.path).replace(/\\/g, '/');
112
-
113
- // Log
114
- if (LOUD) {
115
- logger.log(`Processing file: ${relativePath}`);
116
- }
117
-
118
- // Change path if it starts with 'pages/'
119
- // if (relativePath.startsWith('pages/')) {
120
- // // Remove 'pages/' prefix
121
- // const newRelativePath = relativePath.replace(/^pages\//, '');
122
-
123
- // // Update file path to remove pages directory
124
- // // This will make src/pages/index.html -> dist/index.html
125
- // file.path = path.join(file.base, newRelativePath);
126
-
127
- // // Log
128
- // logger.log(` -> Moving from pages/ to root: ${newRelativePath}`);
129
- // }
130
-
131
- // Push the file
132
- this.push(file);
133
-
134
- // Continue
135
- callback();
104
+ return new Transform({
105
+ objectMode: true,
106
+ transform(file, _, callback) {
107
+ // Skip if it's a directory
108
+ if (file.isDirectory()) {
109
+ return callback(null, file);
110
+ }
111
+
112
+ // Get relative path from src base
113
+ const relativePath = path.relative(file.base, file.path).replace(/\\/g, '/');
114
+
115
+ // Log
116
+ if (LOUD) {
117
+ logger.log(`Processing file: ${relativePath}`);
118
+ }
119
+
120
+ // Change path if it starts with 'pages/'
121
+ // if (relativePath.startsWith('pages/')) {
122
+ // // Remove 'pages/' prefix
123
+ // const newRelativePath = relativePath.replace(/^pages\//, '');
124
+
125
+ // // Update file path to remove pages directory
126
+ // // This will make src/pages/index.html -> dist/index.html
127
+ // file.path = path.join(file.base, newRelativePath);
128
+
129
+ // // Log
130
+ // logger.log(` -> Moving from pages/ to root: ${newRelativePath}`);
131
+ // }
132
+
133
+ // Push the file
134
+ this.push(file);
135
+
136
+ // Continue
137
+ callback();
138
+ },
136
139
  });
137
140
  }
138
141
 
@@ -2,7 +2,7 @@
2
2
  const Manager = new (require('../../build.js'));
3
3
  const logger = Manager.logger('html');
4
4
  const { src, dest, watch, series } = require('gulp');
5
- const through2 = require('through2');
5
+ const { Transform } = require('node:stream');
6
6
  const jetpack = require('fs-jetpack');
7
7
  const path = require('path');
8
8
  const { template } = require('node-powertools');
@@ -51,86 +51,89 @@ function html(complete) {
51
51
 
52
52
  // Process HTML transform
53
53
  function processHtml(templateContent) {
54
- return through2.obj(function (file, _, callback) {
55
- // Skip if it's a directory
56
- if (file.isDirectory()) {
57
- return callback(null, file);
58
- }
59
-
60
- try {
61
- // Get the view name from the file path
62
- const viewName = path.basename(file.path, '.html');
63
- const relativePath = path.relative(path.join(rootPathProject, 'src/views'), file.dirname);
64
- const viewNameWithPath = relativePath ? `${relativePath}/${viewName}` : viewName;
65
-
66
- // Read the content (body HTML)
67
- const bodyContent = file.contents.toString();
68
-
69
- // Determine the component name for CSS/JS loading
70
- // Template already includes /components/ prefix, so just provide the component path
71
- // Pages can have multiple files (index, pricing, login, etc.)
72
- // Other components (popup, options, etc.) only have index.html
73
- let componentName;
74
- if (relativePath.startsWith('pages/') || relativePath === 'pages') {
75
- // Pages directory: include full path with filename
76
- // pages/index.html -> pages/index
77
- // pages/pricing.html -> pages/pricing
78
- componentName = viewNameWithPath;
79
- } else if (relativePath && viewName === 'index') {
80
- // Other components with index.html: use just the directory name
81
- // popup/index.html -> popup
82
- // options/index.html -> options
83
- componentName = relativePath;
84
- } else if (relativePath) {
85
- // Non-index files in other directories: use full path
86
- componentName = viewNameWithPath;
87
- } else {
88
- // No path: use viewName
89
- componentName = viewName;
54
+ return new Transform({
55
+ objectMode: true,
56
+ transform(file, _, callback) {
57
+ // Skip if it's a directory
58
+ if (file.isDirectory()) {
59
+ return callback(null, file);
90
60
  }
91
61
 
92
- // Prepare template data
93
- const data = {
94
- content: bodyContent,
95
- page: {
96
- name: componentName,
97
- path: viewNameWithPath,
98
- title: config.brand?.name || 'Extension',
99
- },
100
- theme: {
101
- appearance: config.theme?.appearance || 'dark',
102
- },
103
- brand: config.brand || {},
104
- cacheBust: Date.now(),
105
- };
106
-
107
- // Apply template with custom brackets
108
- // First, template the body content to replace any {{ }} placeholders in the view
109
- const templatedBody = template(bodyContent, data, {
110
- brackets: ['{{', '}}'],
111
- });
112
-
113
- // Update data with templated body
114
- data.content = templatedBody;
115
-
116
- // Then template the outer page template
117
- const rendered = template(templateContent, data, {
118
- brackets: ['{{', '}}'],
119
- });
120
-
121
- // Update file contents
122
- file.contents = Buffer.from(rendered);
123
-
124
- // Log
125
- logger.log(`Processed: ${viewNameWithPath}.html`);
126
-
127
- // Push the file
128
- this.push(file);
129
- return callback();
130
- } catch (error) {
131
- logger.error('Error processing HTML:', error);
132
- return callback(error);
133
- }
62
+ try {
63
+ // Get the view name from the file path
64
+ const viewName = path.basename(file.path, '.html');
65
+ const relativePath = path.relative(path.join(rootPathProject, 'src/views'), file.dirname);
66
+ const viewNameWithPath = relativePath ? `${relativePath}/${viewName}` : viewName;
67
+
68
+ // Read the content (body HTML)
69
+ const bodyContent = file.contents.toString();
70
+
71
+ // Determine the component name for CSS/JS loading
72
+ // Template already includes /components/ prefix, so just provide the component path
73
+ // Pages can have multiple files (index, pricing, login, etc.)
74
+ // Other components (popup, options, etc.) only have index.html
75
+ let componentName;
76
+ if (relativePath.startsWith('pages/') || relativePath === 'pages') {
77
+ // Pages directory: include full path with filename
78
+ // pages/index.html -> pages/index
79
+ // pages/pricing.html -> pages/pricing
80
+ componentName = viewNameWithPath;
81
+ } else if (relativePath && viewName === 'index') {
82
+ // Other components with index.html: use just the directory name
83
+ // popup/index.html -> popup
84
+ // options/index.html -> options
85
+ componentName = relativePath;
86
+ } else if (relativePath) {
87
+ // Non-index files in other directories: use full path
88
+ componentName = viewNameWithPath;
89
+ } else {
90
+ // No path: use viewName
91
+ componentName = viewName;
92
+ }
93
+
94
+ // Prepare template data
95
+ const data = {
96
+ content: bodyContent,
97
+ page: {
98
+ name: componentName,
99
+ path: viewNameWithPath,
100
+ title: config.brand?.name || 'Extension',
101
+ },
102
+ theme: {
103
+ appearance: config.theme?.appearance || 'dark',
104
+ },
105
+ brand: config.brand || {},
106
+ cacheBust: Date.now(),
107
+ };
108
+
109
+ // Apply template with custom brackets
110
+ // First, template the body content to replace any {{ }} placeholders in the view
111
+ const templatedBody = template(bodyContent, data, {
112
+ brackets: ['{{', '}}'],
113
+ });
114
+
115
+ // Update data with templated body
116
+ data.content = templatedBody;
117
+
118
+ // Then template the outer page template
119
+ const rendered = template(templateContent, data, {
120
+ brackets: ['{{', '}}'],
121
+ });
122
+
123
+ // Update file contents
124
+ file.contents = Buffer.from(rendered);
125
+
126
+ // Log
127
+ logger.log(`Processed: ${viewNameWithPath}.html`);
128
+
129
+ // Push the file
130
+ this.push(file);
131
+ return callback();
132
+ } catch (error) {
133
+ logger.error('Error processing HTML:', error);
134
+ return callback(error);
135
+ }
136
+ },
134
137
  });
135
138
  }
136
139
 
@@ -1,49 +1,49 @@
1
1
  // Libraries
2
- const through2 = require('through2');
2
+ const { Transform } = require('node:stream');
3
3
  const { template } = require('node-powertools');
4
4
  const path = require('path');
5
5
 
6
6
  /**
7
- * Creates a through2 transform stream that processes template variables in files
7
+ * Creates a transform stream that processes template variables in files
8
8
  **/
9
9
  function createTemplateTransform(data) {
10
10
  const extensions = ['html', 'md', 'liquid', 'json', 'yml', 'yaml']
11
11
 
12
- return through2.obj(function(file, encoding, callback) {
13
- // Skip directories
14
- if (file.isDirectory()) {
15
- return callback(null, file);
16
- }
17
-
18
- // Check if file extension matches
19
- const ext = path.extname(file.path).toLowerCase().slice(1);
20
- if (!extensions.includes(ext)) {
21
- return callback(null, file);
22
- }
23
-
24
- // Log
25
- // console.log(`Processing file: ${file.path}`);
26
-
27
- // Process the file contents
28
- try {
29
- const contents = file.contents.toString();
30
-
31
- // Process templates
32
- const templated = template(contents, data, {
33
- brackets: ['[', ']'],
34
- });
35
-
36
- // Update file contents if changed
37
- if (contents !== templated) {
38
- file.contents = Buffer.from(templated);
39
- const relativePath = file.relative || file.path;
12
+ return new Transform({
13
+ objectMode: true,
14
+ transform(file, encoding, callback) {
15
+ // Skip directories
16
+ if (file.isDirectory()) {
17
+ return callback(null, file);
40
18
  }
41
- } catch (error) {
42
- console.error(`Error processing templates in ${file.path}:`, error);
43
- }
44
19
 
45
- // Pass the file through
46
- callback(null, file);
20
+ // Check if file extension matches
21
+ const ext = path.extname(file.path).toLowerCase().slice(1);
22
+ if (!extensions.includes(ext)) {
23
+ return callback(null, file);
24
+ }
25
+
26
+ // Process the file contents
27
+ try {
28
+ const contents = file.contents.toString();
29
+
30
+ // Process templates
31
+ const templated = template(contents, data, {
32
+ brackets: ['[', ']'],
33
+ });
34
+
35
+ // Update file contents if changed
36
+ if (contents !== templated) {
37
+ file.contents = Buffer.from(templated);
38
+ const relativePath = file.relative || file.path;
39
+ }
40
+ } catch (error) {
41
+ console.error(`Error processing templates in ${file.path}:`, error);
42
+ }
43
+
44
+ // Pass the file through
45
+ callback(null, file);
46
+ },
47
47
  });
48
48
  }
49
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-extension-manager",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "description": "Browser Extension Manager dependency manager",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -32,11 +32,15 @@
32
32
  "ext": "bin/browser-extension-manager",
33
33
  "mgr": "bin/browser-extension-manager"
34
34
  },
35
+ "files": [
36
+ "dist"
37
+ ],
35
38
  "preparePackage": {
36
39
  "input": "./src",
37
40
  "output": "./dist",
38
41
  "replace": {},
39
- "type": "copy"
42
+ "type": "copy",
43
+ "hooks": {}
40
44
  },
41
45
  "projectScripts": {
42
46
  "start": "npx mgr clean && npx mgr setup && npm run gulp --",
@@ -69,17 +73,17 @@
69
73
  },
70
74
  "homepage": "https://template.itwcreativeworks.com",
71
75
  "dependencies": {
72
- "@anthropic-ai/claude-agent-sdk": "^0.2.90",
76
+ "@anthropic-ai/claude-agent-sdk": "^0.2.138",
73
77
  "@babel/core": "^7.29.0",
74
- "@babel/preset-env": "^7.29.2",
78
+ "@babel/preset-env": "^7.29.5",
75
79
  "@popperjs/core": "^2.11.8",
76
80
  "babel-loader": "^10.1.1",
77
81
  "chalk": "^5.6.2",
78
- "dotenv": "^17.4.0",
82
+ "dotenv": "^17.4.2",
79
83
  "fs-jetpack": "^5.1.0",
80
84
  "glob": "^13.0.6",
81
85
  "gulp-clean-css": "^4.3.0",
82
- "gulp-filter": "^9.0.1",
86
+ "gulp-filter": "^10.0.0",
83
87
  "gulp-rename": "^2.1.0",
84
88
  "gulp-responsive-modern": "^1.0.0",
85
89
  "gulp-sass": "^6.0.1",
@@ -89,11 +93,10 @@
89
93
  "minimatch": "^10.2.5",
90
94
  "node-powertools": "^3.0.0",
91
95
  "npm-api": "^1.0.1",
92
- "sass": "^1.98.0",
93
- "through2": "^4.0.2",
94
- "web-manager": "^4.1.36",
95
- "webpack": "^5.105.4",
96
- "wonderful-fetch": "^2.0.4",
96
+ "sass": "^1.99.0",
97
+ "web-manager": "^4.1.41",
98
+ "webpack": "^5.106.2",
99
+ "wonderful-fetch": "^2.0.5",
97
100
  "wonderful-version": "^1.3.2",
98
101
  "ws": "^8.20.0",
99
102
  "yargs": "^18.0.0"
@@ -102,6 +105,6 @@
102
105
  "gulp": "^5.0.1"
103
106
  },
104
107
  "devDependencies": {
105
- "prepare-package": "^2.0.7"
108
+ "prepare-package": "^2.1.0"
106
109
  }
107
110
  }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v22/*
package/CHANGELOG.md DELETED
@@ -1,156 +0,0 @@
1
- # CHANGELOG
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
-
7
- ## Changelog Categories
8
-
9
- - `BREAKING` for breaking changes.
10
- - `Added` for new features.
11
- - `Changed` for changes in existing functionality.
12
- - `Deprecated` for soon-to-be removed features.
13
- - `Removed` for now removed features.
14
- - `Fixed` for any bug fixes.
15
- - `Security` in case of vulnerabilities.
16
-
17
- ---
18
- ## [1.3.44] - 2026-04-01
19
- ### Changed
20
- - Bumped `@anthropic-ai/claude-agent-sdk` from ^0.2.76 to ^0.2.90
21
- - Bumped `@babel/preset-env` from ^7.29.0 to ^7.29.2
22
- - Bumped `dotenv` from ^17.3.1 to ^17.4.0
23
- - Bumped `lodash` from ^4.17.23 to ^4.18.1
24
- - Bumped `minimatch` from ^10.2.4 to ^10.2.5
25
- - Bumped `web-manager` from ^4.1.28 to ^4.1.33
26
- - Bumped `ws` from ^8.19.0 to ^8.20.0
27
-
28
- ## [1.3.43] - 2026-03-16
29
- ### Added
30
- - Set `private: true` on consuming projects during setup to prevent accidental npm publishes
31
-
32
- ## [1.3.42] - 2026-03-15
33
- ### Changed
34
- - Bumped `node-powertools` from ^2.3.2 to ^3.0.0
35
- - Bumped `wonderful-fetch` from ^1.3.4 to ^2.0.4
36
- - Bumped `web-manager` from ^4.1.27 to ^4.1.28
37
- - Bumped `prepare-package` from ^1.2.6 to ^2.0.7
38
- - Added `preparePackage.type: "copy"` config to package.json
39
-
40
- ## [1.3.40] - 2026-03-14
41
- ### Changed
42
- - Migrated `app` references to `brand` namespace (`this.app` → `this.brand.id`, `options.app.id` → `options.brand.id`)
43
- - Nested brand image properties under `brand.images.*` (`brandmark`, `wordmark`, `combomark`)
44
-
45
- ## [1.3.17] - 2025-12-23
46
- ### Changed
47
- - Auth system now uses messaging instead of `chrome.storage` for cross-context sync
48
- - Background.js is the source of truth; contexts sync via `bxm:syncAuth` message on load
49
- - Fresh custom tokens fetched from server only when context UID differs from background UID
50
-
51
- ### Fixed
52
- - Auth failures caused by expired custom tokens (tokens no longer stored, fetched fresh when needed)
53
-
54
- ## [1.3.0] - 2025-12-16
55
-
56
- ### Added
57
- - Multi-target builds for Chromium, Firefox, and Opera with automatic manifest adjustments
58
- - Chromium build uses `background.service_worker`, Firefox build uses `background.scripts`
59
- - Opera build auto-resolves `__MSG_*__` placeholders in `short_name` (Opera enforces 12-char limit including placeholder text)
60
- - Browser-specific `TARGETS` config object with `adjustManifest()` functions for each target
61
- - Opera loading instructions in BUILD_INSTRUCTIONS.md
62
-
63
- ### Changed
64
- - Packaged output structure changed from `packaged/raw/` to `packaged/{chromium,firefox,opera}/raw/`
65
- - Extension zip moved from `packaged/extension.zip` to `packaged/{chromium,firefox,opera}/extension.zip`
66
- - `package.js` now creates separate builds for each browser target using configurable `TARGETS` object
67
- - `publish.js` uses target-specific paths (chromium zip for Chrome/Edge, firefox raw for Firefox, opera zip for Opera)
68
- - `audit.js` audits chromium build (code is identical between targets)
69
- - Manifest compilation now uses 3-step process: apply defaults → target adjustments → cleanup
70
-
71
- ### Fixed
72
- - Packaged extensions no longer include `.scss`, `.sass`, `.ts`, or `.DS_Store` files (caused store rejections)
73
-
74
- ## [1.1.13] - 2025-11-26
75
- ### Added
76
- - Default `.env` file with publish credential templates for all stores
77
- - Intelligent line-based merging for `.gitignore` and `.env` files with section markers
78
- - Template variable support for `.yml` and `.yaml` files
79
-
80
- ### Changed
81
- - Credentials now read from `.env` file instead of config (better security)
82
- - `.gitignore` and `.env` files use section markers to separate defaults from custom values
83
- - Template transform now passes `versions` data for workflow templating
84
-
85
- ## [1.1.6] - 2025-11-14
86
- ### Added
87
- - Bootstrap exposure to `window.bootstrap` in all UI components (popup, options, sidepanel, page)
88
- - `@popperjs/core` dependency for Bootstrap's Dropdown, Tooltip, and Popover components
89
- - Project-specific JS files to webpack watch paths for improved hot reloading
90
-
91
- ### Changed
92
- - Modernized content.js manager from prototype-based to ES6 class syntax with async/await
93
- - Updated affiliatizer import to use dynamic import in content.js
94
- - Improved logging consistency across all manager classes
95
-
96
- ## [1.1.1] - 2025-11-13
97
- ### Changed
98
- - Simplified build.js configuration generation by removing webManager config overrides
99
- - Improved theme JS file watching in webpack config
100
- - Updated Firebase dependencies to latest versions (firebase 12.6.0)
101
-
102
- ### Added
103
- - Cache busting support for CSS/JS includes in page template (?cb={{ cacheBust }})
104
- - build.js script loading to page template for runtime configuration
105
- - web-manager watch path for improved development workflow
106
-
107
- ### Fixed
108
- - Removed verbose logging in background.js initialization
109
- - Browser caching issues during development with cache-busted resource URLs
110
-
111
- ## [1.1.0] - 2025-11-13
112
- ### BREAKING
113
- - Complete CSS architecture overhaul - projects using old structure will need migration
114
- - Removed static Bootstrap CSS files in favor of SCSS source compilation
115
- - Changed default file structure for consuming projects
116
-
117
- ### Added
118
- - Modular component-based CSS architecture
119
- - New main entry point: `browser-extension-manager.scss`
120
- - Core CSS modules: initialize, utilities, animations
121
- - Component-specific CSS directories with bundle support
122
- - Full Bootstrap 5 SCSS source integration
123
- - Classy theme with custom design system
124
- - Theme template (`_template/`) for creating new themes
125
- - New component managers: popup, options, sidepanel, page
126
- - HTML template system via `page-template.html`
127
- - Views directory structure for organized HTML templates
128
- - Component-specific override system in defaults
129
- - New gulp tasks: `html.js`, `audit.js`
130
- - Webpack plugin to strip dev-only code blocks
131
- - `gulp-filter` dependency for advanced build filtering
132
- - Package exports for all component managers
133
-
134
- ### Changed
135
- - Upgraded Bootstrap theme to use full source (scss/) instead of compiled CSS
136
- - Refactored defaults structure with component-specific organization
137
- - Reorganized project architecture for better modularity
138
- - Updated build system to support new component architecture
139
-
140
- ### Removed
141
- - `fontawesome.scss` (moved to component-specific imports)
142
- - `main.scss` (replaced by component system)
143
- - Static Bootstrap CSS/JS files (now compiled from source)
144
- - Legacy HTML pages in `src/defaults/src/pages/`
145
- - Legacy asset structure in defaults
146
- - Obsolete `themes.js` gulp task
147
- - Old static JavaScript files (background.js, popup.js, etc. in defaults)
148
-
149
- ### Fixed
150
- - Improved maintainability with modular architecture
151
- - Better theme customization support
152
- - Enhanced build process for component isolation
153
-
154
- ## [1.0.0] - 2024-06-19
155
- ### Added
156
- - Initial release of the project 🚀