extension-develop 3.5.0-next.4 → 3.5.0-next.6

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.
package/dist/module.cjs CHANGED
@@ -133609,7 +133609,7 @@ var __webpack_modules__ = {
133609
133609
  },
133610
133610
  "./package.json" (module) {
133611
133611
  "use strict";
133612
- module.exports = JSON.parse('{"rE":"3.5.0-next.4","El":{"@rspack/core":"^1.7.2","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","firefox-location2":"3.0.0","go-git-it":"^5.0.3","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
133612
+ module.exports = JSON.parse('{"rE":"3.5.0-next.6","El":{"@rspack/core":"^1.7.2","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","firefox-location2":"3.0.0","go-git-it":"^5.0.3","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
133613
133613
  }
133614
133614
  };
133615
133615
  var __webpack_module_cache__ = {};
@@ -128024,10 +128024,11 @@ var __webpack_exports__ = {};
128024
128024
  (()=>{
128025
128025
  "use strict";
128026
128026
  var external_fs_ = __webpack_require__("fs");
128027
+ const external_os_namespaceObject = require("os");
128027
128028
  var external_path_ = __webpack_require__("path");
128028
128029
  var external_pintor_ = __webpack_require__("pintor");
128029
128030
  var external_pintor_default = /*#__PURE__*/ __webpack_require__.n(external_pintor_);
128030
- var package_namespaceObject = JSON.parse('{"rE":"3.5.0-next.4"}');
128031
+ var package_namespaceObject = JSON.parse('{"rE":"3.5.0-next.6"}');
128031
128032
  function getLoggingPrefix(type) {
128032
128033
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
128033
128034
  if (isAuthor) {
@@ -128730,11 +128731,23 @@ var __webpack_exports__ = {};
128730
128731
  stdio
128731
128732
  });
128732
128733
  }
128734
+ const EXPLICIT_INSTALL_COMMANDS = new Set([
128735
+ 'install',
128736
+ 'i',
128737
+ 'add',
128738
+ 'ci'
128739
+ ]);
128740
+ const EXTENSION_DEPENDENCY_NAMES = new Set([
128741
+ 'extension',
128742
+ 'extension-develop'
128743
+ ]);
128733
128744
  function isNpxExec() {
128734
128745
  const command = process.env.npm_config_command || '';
128735
128746
  if ('exec' === command || 'dlx' === command || 'npx' === command) return true;
128736
128747
  const cwd = process.cwd();
128737
128748
  if (cwd.includes(`${external_path_.sep}.npm${external_path_.sep}_npx${external_path_.sep}`) || cwd.includes(`${external_path_.sep}.pnpm${external_path_.sep}dlx${external_path_.sep}`) || cwd.includes(`${external_path_.sep}.bun${external_path_.sep}install${external_path_.sep}cache${external_path_.sep}`)) return true;
128749
+ const moduleDir = __dirname;
128750
+ if (moduleDir.includes(`${external_path_.sep}.npm${external_path_.sep}_npx${external_path_.sep}`) || moduleDir.includes(`${external_path_.sep}.pnpm${external_path_.sep}dlx${external_path_.sep}`) || moduleDir.includes(`${external_path_.sep}.bun${external_path_.sep}install${external_path_.sep}cache${external_path_.sep}`)) return true;
128738
128751
  const argv = process.env.npm_config_argv;
128739
128752
  if (argv) try {
128740
128753
  const parsed = JSON.parse(argv);
@@ -128742,14 +128755,73 @@ var __webpack_exports__ = {};
128742
128755
  if (original.includes('exec') || original.includes('npx') || original.includes('dlx') || original.includes('bunx')) return true;
128743
128756
  } catch {}
128744
128757
  const userAgent = process.env.npm_config_user_agent || '';
128745
- return userAgent.includes('npx');
128758
+ if (userAgent.includes('npx')) return true;
128759
+ const execPath = process.env.npm_execpath || '';
128760
+ if (execPath.includes('npx')) return true;
128761
+ if (execPath.includes('npm-cli.js') && 'exec' === command) return true;
128762
+ return false;
128763
+ }
128764
+ function isExplicitInstallCommand() {
128765
+ const command = process.env.npm_config_command || '';
128766
+ if (EXPLICIT_INSTALL_COMMANDS.has(command)) return true;
128767
+ const argv = process.env.npm_config_argv;
128768
+ if (!argv) return false;
128769
+ try {
128770
+ const parsed = JSON.parse(argv);
128771
+ const original = parsed.original || parsed.cooked || [];
128772
+ return original.some((value)=>EXPLICIT_INSTALL_COMMANDS.has(value));
128773
+ } catch {
128774
+ return false;
128775
+ }
128776
+ }
128777
+ function hasExtensionDependency(packageJsonPath, argv) {
128778
+ try {
128779
+ const contents = external_fs_.readFileSync(packageJsonPath, 'utf8');
128780
+ const parsed = JSON.parse(contents);
128781
+ const dependencies = {
128782
+ ...parsed.dependencies || {},
128783
+ ...parsed.devDependencies || {},
128784
+ ...parsed.optionalDependencies || {}
128785
+ };
128786
+ if (Object.keys(dependencies).some((name)=>EXTENSION_DEPENDENCY_NAMES.has(name))) return true;
128787
+ } catch {
128788
+ return false;
128789
+ }
128790
+ if (!argv) return false;
128791
+ try {
128792
+ const parsed = JSON.parse(argv);
128793
+ const original = parsed.original || parsed.cooked || [];
128794
+ return original.some((value)=>EXTENSION_DEPENDENCY_NAMES.has(value));
128795
+ } catch {
128796
+ return false;
128797
+ }
128798
+ }
128799
+ function logPostinstallDebug() {
128800
+ if ('1' !== process.env.EXTENSION_DEBUG_POSTINSTALL) return;
128801
+ try {
128802
+ const payload = {
128803
+ cwd: process.cwd(),
128804
+ moduleDir: __dirname,
128805
+ initCwd: process.env.INIT_CWD || '',
128806
+ npmConfigCommand: process.env.npm_config_command || '',
128807
+ npmConfigArgv: process.env.npm_config_argv || '',
128808
+ npmConfigUserAgent: process.env.npm_config_user_agent || '',
128809
+ npmConfigPrefix: process.env.npm_config_prefix || '',
128810
+ npmConfigCache: process.env.npm_config_cache || ''
128811
+ };
128812
+ const logPath = external_path_.join(external_os_namespaceObject.tmpdir(), 'extension-postinstall-debug.log');
128813
+ external_fs_.appendFileSync(logPath, `${JSON.stringify(payload)}\n`);
128814
+ } catch {}
128746
128815
  }
128747
128816
  async function runPostinstall() {
128817
+ logPostinstallDebug();
128748
128818
  if ('true' === process.env.EXTENSION_DISABLE_AUTO_INSTALL) return;
128749
128819
  if (isNpxExec()) return;
128820
+ if (!isExplicitInstallCommand()) return;
128750
128821
  const initCwd = process.env.INIT_CWD || process.cwd();
128751
128822
  const packageJsonPath = external_path_.join(initCwd, 'package.json');
128752
128823
  if (!external_fs_.existsSync(packageJsonPath)) return;
128824
+ if (!hasExtensionDependency(packageJsonPath, process.env.npm_config_argv)) return;
128753
128825
  try {
128754
128826
  const projectStructure = {
128755
128827
  manifestPath: external_path_.join(initCwd, 'manifest.json'),
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "name": "extension-develop",
26
- "version": "3.5.0-next.4",
26
+ "version": "3.5.0-next.6",
27
27
  "description": "Develop, build, preview, and package Extension.js projects.",
28
28
  "author": {
29
29
  "name": "Cezar Augusto",