extension-develop 3.5.0-next.3 → 3.5.0-next.5

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.3","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.5","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.3"}');
128031
+ var package_namespaceObject = JSON.parse('{"rE":"3.5.0-next.5"}');
128031
128032
  function getLoggingPrefix(type) {
128032
128033
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
128033
128034
  if (isAuthor) {
@@ -128730,9 +128731,17 @@ 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
+ ]);
128733
128740
  function isNpxExec() {
128734
128741
  const command = process.env.npm_config_command || '';
128735
128742
  if ('exec' === command || 'dlx' === command || 'npx' === command) return true;
128743
+ const cwd = process.cwd();
128744
+ 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;
128736
128745
  const argv = process.env.npm_config_argv;
128737
128746
  if (argv) try {
128738
128747
  const parsed = JSON.parse(argv);
@@ -128740,11 +128749,44 @@ var __webpack_exports__ = {};
128740
128749
  if (original.includes('exec') || original.includes('npx') || original.includes('dlx') || original.includes('bunx')) return true;
128741
128750
  } catch {}
128742
128751
  const userAgent = process.env.npm_config_user_agent || '';
128743
- return userAgent.includes('npx');
128752
+ if (userAgent.includes('npx')) return true;
128753
+ const execPath = process.env.npm_execpath || '';
128754
+ if (execPath.includes('npx')) return true;
128755
+ if (execPath.includes('npm-cli.js') && 'exec' === command) return true;
128756
+ return false;
128757
+ }
128758
+ function isExplicitInstallCommand() {
128759
+ const command = process.env.npm_config_command || '';
128760
+ if (EXPLICIT_INSTALL_COMMANDS.has(command)) return true;
128761
+ const argv = process.env.npm_config_argv;
128762
+ if (!argv) return false;
128763
+ try {
128764
+ const parsed = JSON.parse(argv);
128765
+ const original = parsed.original || parsed.cooked || [];
128766
+ return original.some((value)=>EXPLICIT_INSTALL_COMMANDS.has(value));
128767
+ } catch {
128768
+ return false;
128769
+ }
128770
+ }
128771
+ function logPostinstallDebug() {
128772
+ if ('1' !== process.env.EXTENSION_DEBUG_POSTINSTALL) return;
128773
+ try {
128774
+ const payload = {
128775
+ cwd: process.cwd(),
128776
+ initCwd: process.env.INIT_CWD || '',
128777
+ npmConfigCommand: process.env.npm_config_command || '',
128778
+ npmConfigArgv: process.env.npm_config_argv || '',
128779
+ npmConfigUserAgent: process.env.npm_config_user_agent || ''
128780
+ };
128781
+ const logPath = external_path_.join(external_os_namespaceObject.tmpdir(), 'extension-postinstall-debug.log');
128782
+ external_fs_.appendFileSync(logPath, `${JSON.stringify(payload)}\n`);
128783
+ } catch {}
128744
128784
  }
128745
128785
  async function runPostinstall() {
128786
+ logPostinstallDebug();
128746
128787
  if ('true' === process.env.EXTENSION_DISABLE_AUTO_INSTALL) return;
128747
128788
  if (isNpxExec()) return;
128789
+ if (!isExplicitInstallCommand()) return;
128748
128790
  const initCwd = process.env.INIT_CWD || process.cwd();
128749
128791
  const packageJsonPath = external_path_.join(initCwd, 'package.json');
128750
128792
  if (!external_fs_.existsSync(packageJsonPath)) return;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "name": "extension-develop",
26
- "version": "3.5.0-next.3",
26
+ "version": "3.5.0-next.5",
27
27
  "description": "Develop, build, preview, and package Extension.js projects.",
28
28
  "author": {
29
29
  "name": "Cezar Augusto",