extension-develop 3.5.0-next.16 → 3.5.0-next.18

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 (2) hide show
  1. package/dist/module.cjs +99 -74
  2. package/package.json +1 -1
package/dist/module.cjs CHANGED
@@ -130825,8 +130825,11 @@ var __webpack_modules__ = {
130825
130825
  var path__rspack_import_0 = __webpack_require__("path");
130826
130826
  var fs__rspack_import_1 = __webpack_require__("fs");
130827
130827
  var _messages__rspack_import_2 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
130828
- var _webpack_lib_check_build_dependencies__rspack_import_3 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
130829
- var _webpack_lib_package_manager__rspack_import_4 = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
130828
+ var pintor__rspack_import_3 = __webpack_require__("pintor");
130829
+ var pintor__rspack_import_3_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_3);
130830
+ var _webpack_lib_check_build_dependencies__rspack_import_4 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
130831
+ var _webpack_lib_package_manager__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
130832
+ var _webpack_lib_progress__rspack_import_6 = __webpack_require__("./webpack/webpack-lib/progress.ts");
130830
130833
  function parseJsonSafe(text) {
130831
130834
  const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
130832
130835
  return JSON.parse(s || '{}');
@@ -130930,13 +130933,13 @@ var __webpack_modules__ = {
130930
130933
  }
130931
130934
  async function execInstallWithFallback(command, options) {
130932
130935
  try {
130933
- await (0, _webpack_lib_package_manager__rspack_import_4.Qt)(command.command, command.args, {
130936
+ await (0, _webpack_lib_package_manager__rspack_import_5.Qt)(command.command, command.args, {
130934
130937
  cwd: options.cwd,
130935
130938
  stdio: 'inherit'
130936
130939
  });
130937
130940
  return;
130938
130941
  } catch (error) {
130939
- if (options.fallbackNpmCommand && isMissingManagerError(error)) return void await (0, _webpack_lib_package_manager__rspack_import_4.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
130942
+ if (options.fallbackNpmCommand && isMissingManagerError(error)) return void await (0, _webpack_lib_package_manager__rspack_import_5.Qt)(options.fallbackNpmCommand.command, options.fallbackNpmCommand.args, {
130940
130943
  cwd: options.cwd,
130941
130944
  stdio: 'inherit'
130942
130945
  });
@@ -130944,7 +130947,7 @@ var __webpack_modules__ = {
130944
130947
  }
130945
130948
  }
130946
130949
  function resolveDevelopInstallRoot() {
130947
- const directRoot = (0, _webpack_lib_check_build_dependencies__rspack_import_3.w1)();
130950
+ const directRoot = (0, _webpack_lib_check_build_dependencies__rspack_import_4.w1)();
130948
130951
  if (directRoot) return directRoot;
130949
130952
  try {
130950
130953
  const candidateRoot = findDevelopRootFrom(__dirname);
@@ -130963,7 +130966,7 @@ var __webpack_modules__ = {
130963
130966
  }
130964
130967
  function getOptionalInstallCommand(pm, dependencies, installBaseDir) {
130965
130968
  const pmName = pm.name;
130966
- if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
130969
+ if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
130967
130970
  '--silent',
130968
130971
  'add',
130969
130972
  ...dependencies,
@@ -130971,7 +130974,7 @@ var __webpack_modules__ = {
130971
130974
  installBaseDir,
130972
130975
  '--optional'
130973
130976
  ]);
130974
- if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
130977
+ if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
130975
130978
  '--silent',
130976
130979
  'install',
130977
130980
  ...dependencies,
@@ -130979,7 +130982,7 @@ var __webpack_modules__ = {
130979
130982
  installBaseDir,
130980
130983
  '--save-optional'
130981
130984
  ]);
130982
- if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
130985
+ if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
130983
130986
  'add',
130984
130987
  ...dependencies,
130985
130988
  '--dir',
@@ -130987,14 +130990,14 @@ var __webpack_modules__ = {
130987
130990
  '--save-optional',
130988
130991
  '--silent'
130989
130992
  ]);
130990
- if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
130993
+ if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
130991
130994
  'add',
130992
130995
  ...dependencies,
130993
130996
  '--cwd',
130994
130997
  installBaseDir,
130995
130998
  '--optional'
130996
130999
  ]);
130997
- return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131000
+ return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
130998
131001
  '--silent',
130999
131002
  'install',
131000
131003
  ...dependencies,
@@ -131018,32 +131021,32 @@ var __webpack_modules__ = {
131018
131021
  '--prefix',
131019
131022
  installBaseDir
131020
131023
  ] : [];
131021
- if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131024
+ if ('yarn' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
131022
131025
  'install',
131023
131026
  '--silent',
131024
131027
  ...dirArgs
131025
131028
  ]);
131026
- if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131029
+ if ('npm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
131027
131030
  'install',
131028
131031
  '--silent',
131029
131032
  ...dirArgs
131030
131033
  ]);
131031
- if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131034
+ if ('pnpm' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
131032
131035
  'install',
131033
131036
  '--silent',
131034
131037
  ...dirArgs
131035
131038
  ]);
131036
- if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131039
+ if ('bun' === pmName) return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
131037
131040
  'install',
131038
131041
  ...dirArgs
131039
131042
  ]);
131040
- return (0, _webpack_lib_package_manager__rspack_import_4.tj)(pm, [
131043
+ return (0, _webpack_lib_package_manager__rspack_import_5.tj)(pm, [
131041
131044
  'install',
131042
131045
  '--silent',
131043
131046
  ...dirArgs
131044
131047
  ]);
131045
131048
  }
131046
- async function installOptionalDependencies(integration, dependencies) {
131049
+ async function installOptionalDependencies(integration, dependencies, options) {
131047
131050
  if (!dependencies.length) return;
131048
131051
  let pm;
131049
131052
  let wslContext;
@@ -131051,14 +131054,14 @@ var __webpack_modules__ = {
131051
131054
  try {
131052
131055
  installBaseDir = resolveDevelopInstallRoot();
131053
131056
  if (!installBaseDir) throw new Error(_messages__rspack_import_2.eG(integration));
131054
- pm = (0, _webpack_lib_package_manager__rspack_import_4._c)({
131057
+ pm = (0, _webpack_lib_package_manager__rspack_import_5._c)({
131055
131058
  cwd: installBaseDir
131056
131059
  });
131057
131060
  wslContext = resolveWslContext(installBaseDir);
131058
131061
  if (!wslContext.useWsl) pm = await preferCorepackFallback(pm);
131059
131062
  const installCommand = getOptionalInstallCommand(pm, dependencies, wslContext.installDir || installBaseDir);
131060
131063
  const execCommand = wrapCommandForWsl(installCommand, wslContext);
131061
- const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_4.sX)([
131064
+ const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_5.sX)([
131062
131065
  '--silent',
131063
131066
  'install',
131064
131067
  ...dependencies,
@@ -131070,18 +131073,30 @@ var __webpack_modules__ = {
131070
131073
  const setupMessages = _messages__rspack_import_2._j([
131071
131074
  integration
131072
131075
  ], integration, isAuthor);
131073
- const log = isAuthor ? console.warn : console.log;
131074
- setupMessages.forEach((message)=>log(message));
131075
- await execInstallWithFallback(execCommand, {
131076
- cwd: wslContext.useWsl ? void 0 : installBaseDir,
131077
- fallbackNpmCommand
131076
+ const setupMessage = setupMessages[0];
131077
+ const hasIndex = Boolean(options?.index && options?.total);
131078
+ const setupMessageWithIndex = hasIndex ? setupMessage.replace('►►► ', `►►► [${options?.index}/${options?.total}] `) : setupMessage;
131079
+ const progressEnabled = !isAuthor && (0, _webpack_lib_progress__rspack_import_6.u)();
131080
+ const progress = (0, _webpack_lib_progress__rspack_import_6.J)(setupMessageWithIndex, {
131081
+ enabled: progressEnabled,
131082
+ persistLabel: true
131078
131083
  });
131084
+ if (isAuthor) console.warn(setupMessageWithIndex);
131085
+ else if (!progressEnabled) console.log(setupMessageWithIndex);
131086
+ try {
131087
+ await execInstallWithFallback(execCommand, {
131088
+ cwd: wslContext.useWsl ? void 0 : installBaseDir,
131089
+ fallbackNpmCommand
131090
+ });
131091
+ } finally{
131092
+ progress.stop();
131093
+ }
131079
131094
  await new Promise((resolve)=>setTimeout(resolve, 500));
131080
131095
  if (isAuthor) {
131081
131096
  console.log(_messages__rspack_import_2.cr(integration));
131082
131097
  const rootInstall = getRootInstallCommand(pm, wslContext.useWsl ? wslContext.installDir : void 0);
131083
131098
  const rootCommand = wrapCommandForWsl(rootInstall, wslContext);
131084
- const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_4.sX)([
131099
+ const rootFallbackCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_5.sX)([
131085
131100
  '--silent',
131086
131101
  'install',
131087
131102
  '--prefix',
@@ -131119,9 +131134,15 @@ var __webpack_modules__ = {
131119
131134
  }
131120
131135
  async function installOptionalDependenciesBatch(plans) {
131121
131136
  if (!plans.length) return;
131122
- for (const plan of plans){
131123
- if (!plan.dependencies.length) continue;
131124
- const didInstall = await installOptionalDependencies(plan.integration, plan.dependencies);
131137
+ const executablePlans = plans.filter((plan)=>plan.dependencies.length > 0);
131138
+ if (0 === executablePlans.length) return;
131139
+ const totalDeps = executablePlans.reduce((sum, plan)=>sum + plan.dependencies.length, 0);
131140
+ console.log(`${pintor__rspack_import_3_default().gray('►►►')} Found ${pintor__rspack_import_3_default().yellow(String(totalDeps))} specialized dependencies needing installation...`);
131141
+ for (const [index, plan] of executablePlans.entries()){
131142
+ const didInstall = await installOptionalDependencies(plan.integration, plan.dependencies, {
131143
+ index: index + 1,
131144
+ total: executablePlans.length
131145
+ });
131125
131146
  if (!didInstall) return false;
131126
131147
  }
131127
131148
  return true;
@@ -133005,11 +133026,6 @@ var __webpack_modules__ = {
133005
133026
  if (fs__rspack_import_0.existsSync(fallback)) return fallback;
133006
133027
  return 'cmd.exe';
133007
133028
  }
133008
- function formatCmdArgs(command, args) {
133009
- const quotedCommand = command.includes(' ') ? `"${command}"` : command;
133010
- const quotedArgs = args.map((arg)=>arg.includes(' ') ? `"${arg}"` : arg);
133011
- return `${quotedCommand} ${quotedArgs.join(' ')}`.trim();
133012
- }
133013
133029
  function isWindowsExecutablePath(value) {
133014
133030
  if (!value || 'win32' !== process.platform) return false;
133015
133031
  return /\.(cmd|bat|exe)$/i.test(value);
@@ -133199,7 +133215,8 @@ var __webpack_modules__ = {
133199
133215
  '/d',
133200
133216
  '/s',
133201
133217
  '/c',
133202
- formatCmdArgs(command, args)
133218
+ command,
133219
+ ...args
133203
133220
  ]
133204
133221
  };
133205
133222
  }
@@ -133316,6 +133333,49 @@ var __webpack_modules__ = {
133316
133333
  }
133317
133334
  }
133318
133335
  },
133336
+ "./webpack/webpack-lib/progress.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133337
+ "use strict";
133338
+ __webpack_require__.d(__webpack_exports__, {
133339
+ J: ()=>startProgressBar,
133340
+ u: ()=>shouldShowProgress
133341
+ });
133342
+ function stripAnsi(input) {
133343
+ return input.replace(/\x1b\[[0-9;]*m/g, '');
133344
+ }
133345
+ function shouldShowProgress() {
133346
+ return Boolean(process.stdout.isTTY) && !process.env.CI;
133347
+ }
133348
+ function startProgressBar(label, options) {
133349
+ const enabled = (options?.enabled ?? true) && shouldShowProgress();
133350
+ if (!enabled) return {
133351
+ stop: ()=>void 0
133352
+ };
133353
+ const width = Math.max(10, options?.width ?? 24);
133354
+ const intervalMs = Math.max(50, options?.intervalMs ?? 90);
133355
+ let tick = 0;
133356
+ let lastVisibleLength = 0;
133357
+ const render = ()=>{
133358
+ const filled = tick % (width + 1);
133359
+ const empty = width - filled;
133360
+ const bar = `[${'='.repeat(filled)}${' '.repeat(empty)}]`;
133361
+ const line = `${label} ${bar}`;
133362
+ lastVisibleLength = stripAnsi(line).length;
133363
+ process.stdout.write(`\r${line}`);
133364
+ tick = (tick + 1) % (width + 1);
133365
+ };
133366
+ render();
133367
+ const timer = setInterval(render, intervalMs);
133368
+ return {
133369
+ stop: ()=>{
133370
+ clearInterval(timer);
133371
+ if (process.stdout.isTTY) {
133372
+ process.stdout.write(`\r${' '.repeat(lastVisibleLength)}\r`);
133373
+ if (options?.persistLabel) process.stdout.write(`${label}\n`);
133374
+ }
133375
+ }
133376
+ };
133377
+ }
133378
+ },
133319
133379
  "./webpack/webpack-lib/sanitize.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
133320
133380
  "use strict";
133321
133381
  __webpack_require__.d(__webpack_exports__, {
@@ -133459,7 +133519,7 @@ var __webpack_modules__ = {
133459
133519
  },
133460
133520
  "./package.json" (module) {
133461
133521
  "use strict";
133462
- module.exports = JSON.parse('{"rE":"3.5.0-next.16","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.1.1","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"}}');
133522
+ module.exports = JSON.parse('{"rE":"3.5.0-next.18","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.1.1","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"}}');
133463
133523
  }
133464
133524
  };
133465
133525
  var __webpack_module_cache__ = {};
@@ -133774,42 +133834,7 @@ var __webpack_exports__ = {};
133774
133834
  var webpack_lib_paths = __webpack_require__("./webpack/webpack-lib/paths.ts");
133775
133835
  var check_build_dependencies = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
133776
133836
  var package_manager = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
133777
- function stripAnsi(input) {
133778
- return input.replace(/\x1b\[[0-9;]*m/g, '');
133779
- }
133780
- function shouldShowProgress() {
133781
- return Boolean(process.stdout.isTTY) && !process.env.CI;
133782
- }
133783
- function startProgressBar(label, options) {
133784
- const enabled = (options?.enabled ?? true) && shouldShowProgress();
133785
- if (!enabled) return {
133786
- stop: ()=>void 0
133787
- };
133788
- const width = Math.max(10, options?.width ?? 24);
133789
- const intervalMs = Math.max(50, options?.intervalMs ?? 90);
133790
- let tick = 0;
133791
- let lastVisibleLength = 0;
133792
- const render = ()=>{
133793
- const filled = tick % (width + 1);
133794
- const empty = width - filled;
133795
- const bar = `[${'='.repeat(filled)}${' '.repeat(empty)}]`;
133796
- const line = `${label} ${bar}`;
133797
- lastVisibleLength = stripAnsi(line).length;
133798
- process.stdout.write(`\r${line}`);
133799
- tick = (tick + 1) % (width + 1);
133800
- };
133801
- render();
133802
- const timer = setInterval(render, intervalMs);
133803
- return {
133804
- stop: ()=>{
133805
- clearInterval(timer);
133806
- if (process.stdout.isTTY) {
133807
- process.stdout.write(`\r${' '.repeat(lastVisibleLength)}\r`);
133808
- if (options?.persistLabel) process.stdout.write(`${label}\n`);
133809
- }
133810
- }
133811
- };
133812
- }
133837
+ var webpack_lib_progress = __webpack_require__("./webpack/webpack-lib/progress.ts");
133813
133838
  function getInstallArgs(command, dependencies, dependenciesMap) {
133814
133839
  const depsWithVersions = dependencies.map((dep)=>`${dep}@${dependenciesMap[dep]}`);
133815
133840
  if ('pnpm' === command) return [
@@ -133843,9 +133868,9 @@ var __webpack_exports__ = {};
133843
133868
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
133844
133869
  const stdio = isAuthor ? 'inherit' : 'ignore';
133845
133870
  const progressLabel = messages.xK(dependencies);
133846
- const progressEnabled = !isAuthor && shouldShowProgress();
133871
+ const progressEnabled = !isAuthor && (0, webpack_lib_progress.u)();
133847
133872
  const persistLabel = 'true' === process.env.EXTENSION_ONE_TIME_INSTALL_HINT;
133848
- const progress = startProgressBar(progressLabel, {
133873
+ const progress = (0, webpack_lib_progress.J)(progressLabel, {
133849
133874
  enabled: progressEnabled,
133850
133875
  persistLabel
133851
133876
  });
@@ -133892,9 +133917,9 @@ var __webpack_exports__ = {};
133892
133917
  });
133893
133918
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
133894
133919
  const stdio = isAuthor ? 'inherit' : 'ignore';
133895
- const progressEnabled = !isAuthor && shouldShowProgress();
133920
+ const progressEnabled = !isAuthor && (0, webpack_lib_progress.u)();
133896
133921
  const persistLabel = 'true' === process.env.EXTENSION_ONE_TIME_INSTALL_HINT;
133897
- const progress = startProgressBar(progressLabel, {
133922
+ const progress = (0, webpack_lib_progress.J)(progressLabel, {
133898
133923
  enabled: progressEnabled,
133899
133924
  persistLabel
133900
133925
  });
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "webpack/webpack-lib/build-dependencies.json"
25
25
  ],
26
26
  "name": "extension-develop",
27
- "version": "3.5.0-next.16",
27
+ "version": "3.5.0-next.18",
28
28
  "description": "Develop, build, preview, and package Extension.js projects.",
29
29
  "author": {
30
30
  "name": "Cezar Augusto",