extension-develop 3.1.0-next.10 → 3.1.0-next.12

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 (3) hide show
  1. package/dist/547.js +13 -13
  2. package/dist/module.js +161 -60
  3. package/package.json +1 -1
package/dist/547.js CHANGED
@@ -663,8 +663,8 @@ exports.modules = {
663
663
  const projectPath = compiler.options.context || process.cwd();
664
664
  const plugins = [];
665
665
  const manifestPath = this.manifestPath;
666
- const usingSass = (0, css_lib_integrations.w)(projectPath, 'sass');
667
- const usingLess = (0, css_lib_integrations.w)(projectPath, 'less');
666
+ const usingSass = (0, css_lib_integrations.ws)(projectPath, 'sass');
667
+ const usingLess = (0, css_lib_integrations.ws)(projectPath, 'less');
668
668
  const maybeInstallStylelint = await maybeUseStylelint(projectPath);
669
669
  plugins.push(...maybeInstallStylelint);
670
670
  const maybeInstallSass = await (0, sass.IZ)(projectPath);
@@ -707,8 +707,8 @@ exports.modules = {
707
707
  ].filter(Boolean);
708
708
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
709
709
  const integrations = [];
710
- const usingTailwind = (0, css_lib_integrations.w)(projectPath, 'tailwindcss');
711
- const usingPostcss = (0, css_lib_integrations.w)(projectPath, 'postcss') || void 0 !== findPostCssConfig(projectPath) || usingSass || usingLess || usingTailwind;
710
+ const usingTailwind = (0, css_lib_integrations.ws)(projectPath, 'tailwindcss');
711
+ const usingPostcss = (0, css_lib_integrations.ws)(projectPath, 'postcss') || void 0 !== findPostCssConfig(projectPath) || usingSass || usingLess || usingTailwind;
712
712
  if (usingPostcss) integrations.push('PostCSS');
713
713
  if (usingSass) integrations.push('Sass');
714
714
  if (usingLess) integrations.push('Less');
@@ -1957,7 +1957,7 @@ exports.modules = {
1957
1957
  return lines.join('\n');
1958
1958
  }
1959
1959
  function fileNotFound(errorSourcePath, missingFilePath, opts) {
1960
- if (!errorSourcePath) throw new Error('This operation is impossible. Please report a bug.');
1960
+ if (!errorSourcePath) throw new Error('This state should not occur. Please report a bug.');
1961
1961
  switch(external_path_.extname(missingFilePath)){
1962
1962
  case '.js':
1963
1963
  case '.ts':
@@ -4931,7 +4931,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
4931
4931
  }
4932
4932
  }
4933
4933
  function manifestNotFoundMessageOnly(absPath) {
4934
- return `Check the manifest.json file.\n\nNOT FOUND ${absPath}`;
4934
+ return `Check for a valid manifest.json file.\n\nNOT FOUND ${absPath}`;
4935
4935
  }
4936
4936
  function entryNotFoundMessageOnly(manifestField, absPath) {
4937
4937
  const guidance = `Check the ${manifestField} field in your manifest.json file.`;
@@ -4939,24 +4939,24 @@ Set background.noDynamicEntryWarning to true to disable this warning.
4939
4939
  return guidance + suffix;
4940
4940
  }
4941
4941
  function defaultLocaleSpecifiedButLocalesMissing() {
4942
- return 'Default locale was specified, but _locales subtree is missing.';
4942
+ return 'default_locale is set, but the _locales folder is missing. Add _locales/<default>/messages.json.';
4943
4943
  }
4944
4944
  function defaultLocaleFolderMissing(defaultLocale) {
4945
- return `Default locale folder is missing: _locales/${defaultLocale}`;
4945
+ return `Default locale folder is missing: _locales/${defaultLocale}. Create it and add messages.json.`;
4946
4946
  }
4947
4947
  function defaultLocaleMessagesMissing(defaultLocale) {
4948
- return `Default locale messages.json is missing: _locales/${defaultLocale}/messages.json`;
4948
+ return `Default locale messages.json is missing: _locales/${defaultLocale}/messages.json. Create the file with your strings.`;
4949
4949
  }
4950
4950
  function localesPresentButNoDefaultLocale() {
4951
- return 'The _locales subtree exists but manifest.json is missing default_locale.';
4951
+ return 'The _locales folder exists, but manifest.json is missing default_locale. Add default_locale to manifest.json.';
4952
4952
  }
4953
4953
  function invalidMessagesJson(absPath) {
4954
- return `Invalid JSON in locale messages file: ${absPath}`;
4954
+ return `Invalid JSON in locale messages file: ${absPath}. Fix the JSON syntax and try again.`;
4955
4955
  }
4956
4956
  function missingManifestMessageKey(key, defaultLocale) {
4957
4957
  const header = 'Check the i18n placeholders in your manifest.json file.';
4958
4958
  const localePath = defaultLocale ? `_locales/${defaultLocale}/messages.json` : '_locales/<default>/messages.json';
4959
- const guidance = `The key "${key}" referenced via __MSG_${key}__ must be defined in ${localePath}.`;
4959
+ const guidance = `The key "${key}" referenced via __MSG_${key}__ must be defined in ${localePath}. Add the key to that file.`;
4960
4960
  const final = `MISSING KEY ${key} in ${localePath}`;
4961
4961
  return `${header}\n${guidance}\n\n${final}`;
4962
4962
  }
@@ -6529,7 +6529,7 @@ Set background.noDynamicEntryWarning to true to disable this warning.
6529
6529
  }
6530
6530
  var external_chokidar_ = __webpack_require__("chokidar");
6531
6531
  function serverRestartRequiredFromSpecialFolderMessageOnly(addingOrRemoving, folder, typeOfAsset) {
6532
- return `${external_pintor_default().red('ERROR')} in ${external_pintor_default().yellow('manifest.json')} entrypoint: ${addingOrRemoving} ${external_pintor_default().yellow(typeOfAsset)} in ${external_pintor_default().underline(folder + '/')} requires a server restart.`;
6532
+ return `${external_pintor_default().red('ERROR')} in ${external_pintor_default().yellow('manifest.json')} entrypoint: ${addingOrRemoving} ${external_pintor_default().yellow(typeOfAsset)} in ${external_pintor_default().underline(folder + '/')} requires a dev server restart to apply changes.`;
6533
6533
  }
6534
6534
  function specialFoldersSetupSummary(hasPublic, copyEnabled, ignoredCount) {
6535
6535
  return `Special folders setup — public=${String(hasPublic)}, copy=${String(copyEnabled)}, ignored=${String(ignoredCount)}`;
package/dist/module.js CHANGED
@@ -127598,7 +127598,7 @@ var __webpack_modules__ = {
127598
127598
  return body.join('\n') + '\n';
127599
127599
  }
127600
127600
  function firefoxLaunchCalled() {
127601
- return `${getLoggingPrefix('info')} launchFirefox called!`;
127601
+ return `${getLoggingPrefix('info')} Firefox launch requested.`;
127602
127602
  }
127603
127603
  function firefoxBinaryArgsExtracted(args) {
127604
127604
  return `${getLoggingPrefix('info')} Firefox binary args extracted: ${pintor__rspack_import_0_default().gray(args)}`;
@@ -127640,7 +127640,7 @@ var __webpack_modules__ = {
127640
127640
  return `${getLoggingPrefix('info')} Waiting for Firefox to be ready with remote debugging...`;
127641
127641
  }
127642
127642
  function firefoxRemoteDebuggingReady() {
127643
- return `${getLoggingPrefix('success')} Firefox is ready with remote debugging!`;
127643
+ return `${getLoggingPrefix('success')} Firefox is ready with remote debugging.`;
127644
127644
  }
127645
127645
  function sourceInspectorFirefoxNotReadyYet(retries, maxRetries) {
127646
127646
  return `${getLoggingPrefix('warn')} Firefox not ready yet, retrying... (${pintor__rspack_import_0_default().gray(retries.toString())}/${pintor__rspack_import_0_default().gray(maxRetries.toString())})`;
@@ -127649,7 +127649,7 @@ var __webpack_modules__ = {
127649
127649
  return `${getLoggingPrefix('info')} Waiting for Chrome to be ready with remote debugging...`;
127650
127650
  }
127651
127651
  function chromeRemoteDebuggingReady() {
127652
- return `${getLoggingPrefix('success')} Chrome is ready with remote debugging!`;
127652
+ return `${getLoggingPrefix('success')} Chrome is ready with remote debugging.`;
127653
127653
  }
127654
127654
  function sourceInspectorChromeNotReadyYet(retries, maxRetries) {
127655
127655
  return `${getLoggingPrefix('warn')} Chrome not ready yet, retrying... (${pintor__rspack_import_0_default().gray(retries.toString())}/${pintor__rspack_import_0_default().gray(maxRetries.toString())})`;
@@ -127679,7 +127679,7 @@ var __webpack_modules__ = {
127679
127679
  return `${getLoggingPrefix('success')} Chrome is attached to the target with session ID: ${pintor__rspack_import_0_default().gray(sessionId)}`;
127680
127680
  }
127681
127681
  function sourceInspectorHTMLExtractionComplete() {
127682
- return `${getLoggingPrefix('success')} Chrome HTML extraction is complete`;
127682
+ return `${getLoggingPrefix('success')} Chrome HTML extraction is complete.`;
127683
127683
  }
127684
127684
  function sourceInspectorInspectionFailed(error) {
127685
127685
  return `${getLoggingPrefix('error')} Failed to inspect Chrome source: ${pintor__rspack_import_0_default().red(error)}`;
@@ -127736,7 +127736,7 @@ var __webpack_modules__ = {
127736
127736
  return `${getLoggingPrefix('error')} Failed to update Chrome HTML: ${pintor__rspack_import_0_default().red(error)}`;
127737
127737
  }
127738
127738
  function sourceInspectorCleanupComplete() {
127739
- return `${getLoggingPrefix('success')} Chrome source inspector cleaned up`;
127739
+ return `${getLoggingPrefix('success')} Chrome source inspector cleaned up.`;
127740
127740
  }
127741
127741
  function sourceInspectorCleanupError(error) {
127742
127742
  return `${getLoggingPrefix('error')} Error during Chrome cleanup: ${pintor__rspack_import_0_default().red(error)}`;
@@ -130563,8 +130563,9 @@ var __webpack_modules__ = {
130563
130563
  "./webpack/plugin-css/css-lib/integrations.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
130564
130564
  "use strict";
130565
130565
  __webpack_require__.d(__webpack_exports__, {
130566
- t: ()=>installOptionalDependencies,
130567
- w: ()=>hasDependency
130566
+ Dy: ()=>installOptionalDependenciesBatch,
130567
+ tm: ()=>installOptionalDependencies,
130568
+ ws: ()=>hasDependency
130568
130569
  });
130569
130570
  var path__rspack_import_0 = __webpack_require__("path");
130570
130571
  var fs__rspack_import_1 = __webpack_require__("fs");
@@ -130584,18 +130585,46 @@ var __webpack_modules__ = {
130584
130585
  if (process.env['npm_execpath']) return 'npm';
130585
130586
  return false;
130586
130587
  }
130588
+ function getOptionalInstallCommand(pm, dependencies) {
130589
+ const quotedDir = JSON.stringify(__dirname);
130590
+ if (pm?.name === 'yarn') return `yarn --silent add ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130591
+ if (pm?.name === 'npm' || isFromNpx()) return `npm --silent install ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130592
+ if (isFromPnpx()) return `pnpm --silent add ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130593
+ const pmName = 'string' == typeof pm ? pm : pm?.name || 'npm';
130594
+ return `${pmName} --silent install ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130595
+ }
130596
+ function getRootInstallCommand(pm) {
130597
+ if (pm?.name === 'yarn') return "yarn install --silent";
130598
+ if (pm?.name === 'npm' || isFromNpx()) return "npm install --silent";
130599
+ if (isFromPnpx()) return "pnpm install --silent";
130600
+ return `${'string' == typeof pm ? pm : pm?.name || 'npm'} install --silent`;
130601
+ }
130587
130602
  async function installOptionalDependencies(integration, dependencies) {
130603
+ if (!dependencies.length) return;
130588
130604
  try {
130589
130605
  const pm = await (0, package_manager_detector__rspack_import_4.detect)();
130590
- let installCommand = '';
130591
- const quotedDir = JSON.stringify(__dirname);
130592
- if (pm?.name === 'yarn') installCommand = `yarn --silent add ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130593
- else if (pm?.name === 'npm' || isFromNpx()) installCommand = `npm --silent install ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130594
- else if (isFromPnpx()) installCommand = `pnpm --silent add ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130595
- else {
130596
- const pmName = 'string' == typeof pm ? pm : pm?.name || 'npm';
130597
- installCommand = `${pmName} --silent install ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130606
+ const installCommand = getOptionalInstallCommand(pm, dependencies);
130607
+ console.log(`[${integration}] Installing optional dependencies...`);
130608
+ (0, child_process__rspack_import_2.execSync)(installCommand, {
130609
+ stdio: 'inherit'
130610
+ });
130611
+ await new Promise((r)=>setTimeout(r, 500));
130612
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
130613
+ console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} [${integration}] Installing root dependencies for dev...`);
130614
+ (0, child_process__rspack_import_2.execSync)(getRootInstallCommand(pm), {
130615
+ stdio: 'ignore'
130616
+ });
130598
130617
  }
130618
+ console.log(`[${integration}] Dependencies installed successfully.`);
130619
+ } catch (error) {
130620
+ console.error(`[${integration}] Failed to install dependencies.`, error);
130621
+ }
130622
+ }
130623
+ async function installOptionalDependenciesBatch(integration, dependencies) {
130624
+ if (!dependencies.length) return;
130625
+ try {
130626
+ const pm = await (0, package_manager_detector__rspack_import_4.detect)();
130627
+ const installCommand = getOptionalInstallCommand(pm, dependencies);
130599
130628
  console.log(`[${integration}] Installing optional dependencies...`);
130600
130629
  (0, child_process__rspack_import_2.execSync)(installCommand, {
130601
130630
  stdio: 'inherit'
@@ -130603,8 +130632,7 @@ var __webpack_modules__ = {
130603
130632
  await new Promise((r)=>setTimeout(r, 500));
130604
130633
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
130605
130634
  console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} [${integration}] Installing root dependencies for dev...`);
130606
- const devInstall = pm?.name === 'yarn' ? "yarn install --silent" : pm?.name === 'npm' || isFromNpx() ? "npm install --silent" : isFromPnpx() ? "pnpm install --silent" : `${'string' == typeof pm ? pm : pm?.name || 'npm'} install --silent`;
130607
- (0, child_process__rspack_import_2.execSync)(devInstall, {
130635
+ (0, child_process__rspack_import_2.execSync)(getRootInstallCommand(pm), {
130608
130636
  stdio: 'ignore'
130609
130637
  });
130610
130638
  }
@@ -130714,7 +130742,7 @@ var __webpack_modules__ = {
130714
130742
  var _css_lib_is_content_script__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/is-content-script.ts");
130715
130743
  let userMessageDelivered = false;
130716
130744
  function isUsingLess(projectPath) {
130717
- if ((0, _css_lib_integrations__rspack_import_3.w)(projectPath, 'less')) {
130745
+ if ((0, _css_lib_integrations__rspack_import_3.ws)(projectPath, 'less')) {
130718
130746
  if (!userMessageDelivered) {
130719
130747
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_1_default().brightMagenta('►►► Author says')} ${_css_lib_messages__rspack_import_2.zA('LESS')}`);
130720
130748
  userMessageDelivered = true;
@@ -130733,7 +130761,7 @@ var __webpack_modules__ = {
130733
130761
  'less',
130734
130762
  'less-loader'
130735
130763
  ];
130736
- await (0, _css_lib_integrations__rspack_import_3.t)('LESS', lessDependencies);
130764
+ await (0, _css_lib_integrations__rspack_import_3.tm)('LESS', lessDependencies);
130737
130765
  console.log(_css_lib_messages__rspack_import_2.Jv('LESS'));
130738
130766
  process.exit(0);
130739
130767
  }
@@ -130808,7 +130836,7 @@ var __webpack_modules__ = {
130808
130836
  }
130809
130837
  }
130810
130838
  function isUsingPostCss(projectPath) {
130811
- if ((0, _css_lib_integrations__rspack_import_5.w)(projectPath, 'postcss')) {
130839
+ if ((0, _css_lib_integrations__rspack_import_5.ws)(projectPath, 'postcss')) {
130812
130840
  if (!userMessageDelivered) {
130813
130841
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} ${_css_lib_messages__rspack_import_4.zA('PostCSS')}`);
130814
130842
  userMessageDelivered = true;
@@ -130858,7 +130886,7 @@ var __webpack_modules__ = {
130858
130886
  'postcss',
130859
130887
  'postcss-loader'
130860
130888
  ];
130861
- await (0, _css_lib_integrations__rspack_import_5.t)('PostCSS', postCssDependencies);
130889
+ await (0, _css_lib_integrations__rspack_import_5.tm)('PostCSS', postCssDependencies);
130862
130890
  }
130863
130891
  console.log(_css_lib_messages__rspack_import_4.Jv('PostCSS'));
130864
130892
  process.exit(0);
@@ -130930,7 +130958,7 @@ var __webpack_modules__ = {
130930
130958
  var _css_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
130931
130959
  let userMessageDelivered = false;
130932
130960
  function isUsingSass(projectPath) {
130933
- if ((0, _css_lib_integrations__rspack_import_4.w)(projectPath, 'sass')) {
130961
+ if ((0, _css_lib_integrations__rspack_import_4.ws)(projectPath, 'sass')) {
130934
130962
  if (!userMessageDelivered) {
130935
130963
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_2_default().brightMagenta('►►► Author says')} ${_css_lib_messages__rspack_import_3.zA('SASS')}`);
130936
130964
  userMessageDelivered = true;
@@ -130981,11 +131009,11 @@ var __webpack_modules__ = {
130981
131009
  'postcss-scss',
130982
131010
  'postcss-preset-env'
130983
131011
  ];
130984
- await (0, _css_lib_integrations__rspack_import_4.t)('PostCSS', postCssDependencies);
131012
+ await (0, _css_lib_integrations__rspack_import_4.tm)('PostCSS', postCssDependencies);
130985
131013
  const sassDependencies = [
130986
131014
  'sass-loader'
130987
131015
  ];
130988
- await (0, _css_lib_integrations__rspack_import_4.t)('SASS', sassDependencies);
131016
+ await (0, _css_lib_integrations__rspack_import_4.tm)('SASS', sassDependencies);
130989
131017
  console.log(_css_lib_messages__rspack_import_3.Jv('SASS'));
130990
131018
  process.exit(0);
130991
131019
  }
@@ -131026,7 +131054,7 @@ var __webpack_modules__ = {
131026
131054
  var _css_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
131027
131055
  let userMessageDelivered = false;
131028
131056
  function isUsingTailwind(projectPath) {
131029
- const isUsingTailwind = (0, _css_lib_integrations__rspack_import_4.w)(projectPath, 'tailwindcss') || (0, _css_lib_integrations__rspack_import_4.w)(projectPath, '@tailwindcss/postcss');
131057
+ const isUsingTailwind = (0, _css_lib_integrations__rspack_import_4.ws)(projectPath, 'tailwindcss') || (0, _css_lib_integrations__rspack_import_4.ws)(projectPath, '@tailwindcss/postcss');
131030
131058
  if (isUsingTailwind) {
131031
131059
  if (!userMessageDelivered) {
131032
131060
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${pintor__rspack_import_2_default().brightMagenta('►►► Author says')} ${_css_lib_messages__rspack_import_3.zA('Tailwind')}`);
@@ -131047,9 +131075,10 @@ var __webpack_modules__ = {
131047
131075
  "./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131048
131076
  "use strict";
131049
131077
  __webpack_require__.d(__webpack_exports__, {
131078
+ Dy: ()=>_plugin_css_css_lib_integrations__rspack_import_0.Dy,
131050
131079
  qQ: ()=>isUsingJSFramework,
131051
- tm: ()=>_plugin_css_css_lib_integrations__rspack_import_0.t,
131052
- ws: ()=>_plugin_css_css_lib_integrations__rspack_import_0.w
131080
+ tm: ()=>_plugin_css_css_lib_integrations__rspack_import_0.tm,
131081
+ ws: ()=>_plugin_css_css_lib_integrations__rspack_import_0.ws
131053
131082
  });
131054
131083
  var _plugin_css_css_lib_integrations__rspack_import_0 = __webpack_require__("./webpack/plugin-css/css-lib/integrations.ts");
131055
131084
  function isUsingJSFramework(projectPath) {
@@ -131061,7 +131090,7 @@ var __webpack_modules__ = {
131061
131090
  'solid-js',
131062
131091
  'preact'
131063
131092
  ];
131064
- return frameworks.some((fw)=>__webpack_require__("./webpack/plugin-css/css-lib/integrations.ts").w(projectPath, fw));
131093
+ return frameworks.some((fw)=>__webpack_require__("./webpack/plugin-css/css-lib/integrations.ts").ws(projectPath, fw));
131065
131094
  }
131066
131095
  },
131067
131096
  "./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
@@ -131114,6 +131143,7 @@ var __webpack_modules__ = {
131114
131143
  Jv: ()=>youAreAllSet,
131115
131144
  LR: ()=>creatingTSConfig,
131116
131145
  MH: ()=>jsFrameworksConfigsDetected,
131146
+ Q2: ()=>optionalDepsReady,
131117
131147
  Ty: ()=>isUsingCustomLoader,
131118
131148
  jH: ()=>jsFrameworksIntegrationsEnabled,
131119
131149
  zA: ()=>isUsingIntegration
@@ -131126,6 +131156,10 @@ var __webpack_modules__ = {
131126
131156
  function youAreAllSet(name) {
131127
131157
  return `${pintor__rspack_import_0_default().green('►►►')} ${name} installation completed. Run again to proceed.`;
131128
131158
  }
131159
+ function optionalDepsReady(integrations) {
131160
+ const list = integrations.length > 0 ? integrations.map((name)=>pintor__rspack_import_0_default().yellow(name)).join(', ') : pintor__rspack_import_0_default().gray('optional');
131161
+ return `${pintor__rspack_import_0_default().green('►►►')} All set — ${list} tooling is ready.`;
131162
+ }
131129
131163
  function creatingTSConfig() {
131130
131164
  return `${pintor__rspack_import_0_default().gray('►►►')} Creating default tsconfig.json...`;
131131
131165
  }
@@ -131294,7 +131328,8 @@ var __webpack_modules__ = {
131294
131328
  "./webpack/plugin-js-frameworks/js-tools/svelte.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131295
131329
  "use strict";
131296
131330
  __webpack_require__.d(__webpack_exports__, {
131297
- X: ()=>maybeUseSvelte
131331
+ X: ()=>maybeUseSvelte,
131332
+ a: ()=>isUsingSvelte
131298
131333
  });
131299
131334
  var path__rspack_import_0 = __webpack_require__("path");
131300
131335
  var _js_frameworks_lib_messages__rspack_import_1 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
@@ -131434,8 +131469,7 @@ var __webpack_modules__ = {
131434
131469
  "use strict";
131435
131470
  __webpack_require__.d(__webpack_exports__, {
131436
131471
  eE: ()=>isUsingTypeScript,
131437
- hB: ()=>getUserTypeScriptConfigFile,
131438
- vv: ()=>maybeUseTypeScript
131472
+ hB: ()=>getUserTypeScriptConfigFile
131439
131473
  });
131440
131474
  var path__rspack_import_0 = __webpack_require__("path");
131441
131475
  var fs__rspack_import_1 = __webpack_require__("fs");
@@ -131548,25 +131582,12 @@ var __webpack_modules__ = {
131548
131582
  mode: 'development'
131549
131583
  }), null, 2));
131550
131584
  }
131551
- async function maybeUseTypeScript(projectPath) {
131552
- if (!isUsingTypeScript(projectPath)) return false;
131553
- try {
131554
- require.resolve("typescript");
131555
- } catch (e) {
131556
- const typescriptDependencies = [
131557
- "typescript"
131558
- ];
131559
- await (0, _frameworks_lib_integrations__rspack_import_4.tm)('TypeScript', typescriptDependencies);
131560
- console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('TypeScript'));
131561
- process.exit(0);
131562
- }
131563
- return true;
131564
- }
131565
131585
  },
131566
131586
  "./webpack/plugin-js-frameworks/js-tools/vue.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131567
131587
  "use strict";
131568
131588
  __webpack_require__.d(__webpack_exports__, {
131569
- K: ()=>maybeUseVue
131589
+ K: ()=>maybeUseVue,
131590
+ L: ()=>isUsingVue
131570
131591
  });
131571
131592
  var pintor__rspack_import_0 = __webpack_require__("pintor");
131572
131593
  var pintor__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_0);
@@ -132513,7 +132534,7 @@ var __webpack_modules__ = {
132513
132534
  },
132514
132535
  "./package.json" (module) {
132515
132536
  "use strict";
132516
- module.exports = JSON.parse('{"rE":"3.1.0-next.10","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","chokidar":"^5.0.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","package-manager-detector":"^1.6.0","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"}}');
132537
+ module.exports = JSON.parse('{"rE":"3.1.0-next.12","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","chokidar":"^5.0.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","package-manager-detector":"^1.6.0","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"}}');
132517
132538
  }
132518
132539
  };
132519
132540
  var __webpack_module_cache__ = {};
@@ -133116,26 +133137,101 @@ var __webpack_exports__ = {};
133116
133137
  var vue = __webpack_require__("./webpack/plugin-js-frameworks/js-tools/vue.ts");
133117
133138
  var svelte = __webpack_require__("./webpack/plugin-js-frameworks/js-tools/svelte.ts");
133118
133139
  var typescript = __webpack_require__("./webpack/plugin-js-frameworks/js-tools/typescript.ts");
133140
+ var integrations = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
133119
133141
  var sass = __webpack_require__("./webpack/plugin-css/css-tools/sass.ts");
133120
133142
  var less = __webpack_require__("./webpack/plugin-css/css-tools/less.ts");
133121
133143
  var postcss = __webpack_require__("./webpack/plugin-css/css-tools/postcss.ts");
133122
- async function preflightOptionalDependencies(projectStructure, mode) {
133144
+ var js_frameworks_lib_messages = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
133145
+ function canResolveFromProject(id, projectPath) {
133146
+ try {
133147
+ return require.resolve(id, {
133148
+ paths: [
133149
+ projectPath,
133150
+ process.cwd()
133151
+ ]
133152
+ });
133153
+ } catch {
133154
+ return;
133155
+ }
133156
+ }
133157
+ function canResolve(id) {
133158
+ try {
133159
+ return require.resolve(id);
133160
+ } catch {
133161
+ return;
133162
+ }
133163
+ }
133164
+ async function preflightOptionalDependencies(projectStructure, mode, opts) {
133123
133165
  const { packageJsonDir } = (0, paths.fu)(projectStructure);
133124
133166
  const projectPath = packageJsonDir;
133125
133167
  if (hasPreflightMarker(projectPath)) {
133126
133168
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${external_pintor_default().brightMagenta('►►► Author says')} Optional deps preflight skipped (cache hit).`);
133127
133169
  return;
133128
133170
  }
133129
- await (0, typescript.vv)(projectPath);
133130
- await (0, react.b)(projectPath);
133131
- await (0, preact.b)(projectPath);
133132
- await (0, vue.K)(projectPath);
133133
- await (0, svelte.X)(projectPath, mode);
133134
- await (0, sass.IZ)(projectPath);
133135
- await (0, less.V)(projectPath, projectStructure.manifestPath);
133136
- await (0, postcss.t)(projectPath, {
133137
- mode
133138
- });
133171
+ const missingOptionalDeps = new Set();
133172
+ const usedIntegrations = [];
133173
+ const usesTypeScript = (0, typescript.eE)(projectPath);
133174
+ const usesReact = (0, react.S)(projectPath);
133175
+ const usesPreact = (0, preact.K)(projectPath);
133176
+ const usesVue = (0, vue.L)(projectPath);
133177
+ const usesSvelte = (0, svelte.a)(projectPath);
133178
+ const usesSass = (0, sass.fZ)(projectPath);
133179
+ const usesLess = (0, less.K)(projectPath);
133180
+ const usesPostCss = (0, postcss.A)(projectPath);
133181
+ if (usesTypeScript && !canResolveFromProject("typescript", projectPath)) {
133182
+ missingOptionalDeps.add("typescript");
133183
+ usedIntegrations.push('TypeScript');
133184
+ }
133185
+ if (usesReact) {
133186
+ if (!canResolve('react-refresh')) missingOptionalDeps.add('react-refresh');
133187
+ if (!canResolve('@rspack/plugin-react-refresh')) missingOptionalDeps.add('@rspack/plugin-react-refresh');
133188
+ usedIntegrations.push('React');
133189
+ }
133190
+ if (usesPreact) {
133191
+ if (!canResolve('@prefresh/core')) missingOptionalDeps.add('@prefresh/core');
133192
+ if (!canResolve('@prefresh/utils')) missingOptionalDeps.add('@prefresh/utils');
133193
+ if (!canResolve('@rspack/plugin-preact-refresh')) missingOptionalDeps.add('@rspack/plugin-preact-refresh');
133194
+ if (!canResolve('preact')) missingOptionalDeps.add('preact');
133195
+ usedIntegrations.push('Preact');
133196
+ }
133197
+ if (usesVue) {
133198
+ if (!canResolve('vue-loader')) missingOptionalDeps.add('vue-loader');
133199
+ if (!canResolve('@vue/compiler-sfc')) missingOptionalDeps.add('@vue/compiler-sfc');
133200
+ usedIntegrations.push('Vue');
133201
+ }
133202
+ if (usesSvelte) {
133203
+ if (!canResolveFromProject('svelte-loader', projectPath) && !canResolve('svelte-loader')) missingOptionalDeps.add('svelte-loader');
133204
+ if (!canResolveFromProject("typescript", projectPath)) missingOptionalDeps.add("typescript");
133205
+ usedIntegrations.push('Svelte');
133206
+ }
133207
+ if (usesSass && !canResolve('sass-loader')) {
133208
+ const postCssDeps = [
133209
+ 'postcss-loader',
133210
+ 'postcss-scss',
133211
+ 'postcss-preset-env'
133212
+ ];
133213
+ for (const dep of postCssDeps)if (!canResolve(dep)) missingOptionalDeps.add(dep);
133214
+ missingOptionalDeps.add('sass-loader');
133215
+ usedIntegrations.push('Sass');
133216
+ }
133217
+ if (usesLess && !canResolve('less-loader')) {
133218
+ if (!canResolve('less')) missingOptionalDeps.add('less');
133219
+ missingOptionalDeps.add('less-loader');
133220
+ usedIntegrations.push('Less');
133221
+ }
133222
+ if (usesPostCss && !canResolve('postcss-loader') && !usesSass && !usesLess) {
133223
+ if (!canResolve('postcss')) missingOptionalDeps.add('postcss');
133224
+ missingOptionalDeps.add('postcss-loader');
133225
+ usedIntegrations.push('PostCSS');
133226
+ }
133227
+ if (missingOptionalDeps.size > 0) {
133228
+ await (0, integrations.Dy)('Optional', Array.from(missingOptionalDeps));
133229
+ if (opts?.showRunAgainMessage !== false) {
133230
+ const uniqueIntegrations = Array.from(new Set(usedIntegrations));
133231
+ console.log(js_frameworks_lib_messages.Q2(uniqueIntegrations));
133232
+ }
133233
+ if (opts?.exitOnInstall !== false) process.exit(0);
133234
+ }
133139
133235
  writePreflightMarker(projectPath);
133140
133236
  }
133141
133237
  function shouldRunOptionalPreflight(projectStructure) {
@@ -133146,7 +133242,9 @@ var __webpack_exports__ = {};
133146
133242
  async function ensureProjectReady(projectStructure, mode, opts) {
133147
133243
  const { packageJsonDir } = (0, paths.fu)(projectStructure);
133148
133244
  const result = await ensureDependencies(packageJsonDir, opts);
133149
- if (shouldRunOptionalPreflight(projectStructure)) await preflightOptionalDependencies(projectStructure, mode);
133245
+ if (shouldRunOptionalPreflight(projectStructure)) await preflightOptionalDependencies(projectStructure, mode, {
133246
+ exitOnInstall: opts?.exitOnInstall
133247
+ });
133150
133248
  return result;
133151
133249
  }
133152
133250
  async function extensionBuild(pathOrRemoteUrl, buildOptions) {
@@ -133475,7 +133573,10 @@ var __webpack_exports__ = {};
133475
133573
  }
133476
133574
  async function preflightOptionalDependenciesForProject(pathOrRemoteUrl, mode = 'development') {
133477
133575
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
133478
- await preflightOptionalDependencies(projectStructure, mode);
133576
+ await preflightOptionalDependencies(projectStructure, mode, {
133577
+ exitOnInstall: false,
133578
+ showRunAgainMessage: false
133579
+ });
133479
133580
  }
133480
133581
  })();
133481
133582
  exports.ensureDependencies = __webpack_exports__.ensureDependencies;
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "name": "extension-develop",
25
- "version": "3.1.0-next.10",
25
+ "version": "3.1.0-next.12",
26
26
  "description": "Develop, build, preview, and package Extension.js projects.",
27
27
  "author": {
28
28
  "name": "Cezar Augusto",