extension-develop 3.2.1 → 3.3.0

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/547.js CHANGED
@@ -8586,7 +8586,8 @@ Set background.noDynamicEntryWarning to true to disable this warning.
8586
8586
  });
8587
8587
  function scrubBrand(txt, brand = 'Extension.js') {
8588
8588
  if (!txt) return txt;
8589
- return txt.replace(/\bRspack\b/gi, brand).replace(/\bWebpack\b/gi, brand).replace(/\bwebpack-dev-server\b/gi, `${brand} dev server`).replace(/\bRspackDevServer\b/gi, `${brand} dev server`).replace(/ModuleBuildError:\s*/g, '').replace(/ModuleParseError:\s*/g, '').replace(/Error:\s*Module\s+build\s+failed.*?\n/gi, '').replace(/\n{3,}/g, '\n\n');
8589
+ const safeBrand = brand.replace(/\$/g, '$$$$');
8590
+ return txt.replace(RegExp("(?<!@)\\bRspack\\b", "gi"), safeBrand).replace(RegExp("(?<!@)\\bWebpack\\b", "gi"), safeBrand).replace(RegExp("(?<!@)\\bwebpack-dev-server\\b", "gi"), `${safeBrand} dev server`).replace(RegExp("(?<!@)\\bRspackDevServer\\b", "gi"), `${safeBrand} dev server`).replace(/ModuleBuildError:\s*/g, '').replace(/ModuleParseError:\s*/g, '').replace(/Error:\s*Module\s+build\s+failed.*?\n/gi, '').replace(/\n{3,}/g, '\n\n');
8590
8591
  }
8591
8592
  function makeSanitizedConsole(brand = 'Extension.js') {
8592
8593
  const sanitize = (a)=>'string' == typeof a ? scrubBrand(a, brand) : a;
package/dist/552.js CHANGED
@@ -10,7 +10,8 @@ exports.modules = {
10
10
  });
11
11
  function scrubBrand(txt, brand = 'Extension.js') {
12
12
  if (!txt) return txt;
13
- return txt.replace(/\bRspack\b/gi, brand).replace(/\bWebpack\b/gi, brand).replace(/\bwebpack-dev-server\b/gi, `${brand} dev server`).replace(/\bRspackDevServer\b/gi, `${brand} dev server`).replace(/ModuleBuildError:\s*/g, '').replace(/ModuleParseError:\s*/g, '').replace(/Error:\s*Module\s+build\s+failed.*?\n/gi, '').replace(/\n{3,}/g, '\n\n');
13
+ const safeBrand = brand.replace(/\$/g, '$$$$');
14
+ return txt.replace(RegExp("(?<!@)\\bRspack\\b", "gi"), safeBrand).replace(RegExp("(?<!@)\\bWebpack\\b", "gi"), safeBrand).replace(RegExp("(?<!@)\\bwebpack-dev-server\\b", "gi"), `${safeBrand} dev server`).replace(RegExp("(?<!@)\\bRspackDevServer\\b", "gi"), `${safeBrand} dev server`).replace(/ModuleBuildError:\s*/g, '').replace(/ModuleParseError:\s*/g, '').replace(/Error:\s*Module\s+build\s+failed.*?\n/gi, '').replace(/\n{3,}/g, '\n\n');
14
15
  }
15
16
  function makeSanitizedConsole(brand = 'Extension.js') {
16
17
  const sanitize = (a)=>'string' == typeof a ? scrubBrand(a, brand) : a;
@@ -46,7 +47,7 @@ exports.modules = {
46
47
  errors: true,
47
48
  warnings: true
48
49
  });
49
- if (str) console.error(str);
50
+ if (str) console.error((0, _branding__rspack_import_0.h)(str));
50
51
  } catch {}
51
52
  }
52
53
  }
@@ -7,24 +7,24 @@
7
7
  "theme": {
8
8
  "colors": {
9
9
  "frame": [
10
- 37,
11
- 37,
12
- 39
10
+ 18,
11
+ 18,
12
+ 20
13
13
  ],
14
14
  "frame_inactive": [
15
- 49,
16
- 49,
17
- 53
15
+ 15,
16
+ 15,
17
+ 17
18
18
  ],
19
19
  "toolbar": [
20
- 25,
21
- 25,
22
- 26
20
+ 30,
21
+ 30,
22
+ 32
23
23
  ],
24
24
  "tab_background_text": [
25
- 28,
26
- 28,
27
- 30
25
+ 185,
26
+ 185,
27
+ 191
28
28
  ],
29
29
  "tab_text": [
30
30
  255,
@@ -32,9 +32,9 @@
32
32
  255
33
33
  ],
34
34
  "tab_background_text_inactive": [
35
- 62,
36
- 62,
37
- 66
35
+ 168,
36
+ 168,
37
+ 174
38
38
  ],
39
39
  "tab_text_inactive": [
40
40
  255,
@@ -7,24 +7,24 @@
7
7
  "theme": {
8
8
  "colors": {
9
9
  "frame": [
10
- 37,
11
- 37,
12
- 39
10
+ 18,
11
+ 18,
12
+ 20
13
13
  ],
14
14
  "frame_inactive": [
15
- 49,
16
- 49,
17
- 53
15
+ 15,
16
+ 15,
17
+ 17
18
18
  ],
19
19
  "toolbar": [
20
- 25,
21
- 25,
22
- 26
20
+ 30,
21
+ 30,
22
+ 32
23
23
  ],
24
24
  "tab_background_text": [
25
- 28,
26
- 28,
27
- 30
25
+ 185,
26
+ 185,
27
+ 191
28
28
  ],
29
29
  "tab_text": [
30
30
  255,
@@ -32,9 +32,9 @@
32
32
  255
33
33
  ],
34
34
  "tab_background_text_inactive": [
35
- 62,
36
- 62,
37
- 66
35
+ 168,
36
+ 168,
37
+ 174
38
38
  ],
39
39
  "tab_text_inactive": [
40
40
  255,
@@ -7,24 +7,24 @@
7
7
  "theme": {
8
8
  "colors": {
9
9
  "frame": [
10
- 37,
11
- 37,
12
- 39
10
+ 18,
11
+ 18,
12
+ 20
13
13
  ],
14
14
  "frame_inactive": [
15
- 49,
16
- 49,
17
- 53
15
+ 15,
16
+ 15,
17
+ 17
18
18
  ],
19
19
  "toolbar": [
20
- 25,
21
- 25,
22
- 26
20
+ 30,
21
+ 30,
22
+ 32
23
23
  ],
24
24
  "tab_background_text": [
25
- 28,
26
- 28,
27
- 30
25
+ 185,
26
+ 185,
27
+ 191
28
28
  ],
29
29
  "tab_text": [
30
30
  255,
@@ -32,9 +32,9 @@
32
32
  255
33
33
  ],
34
34
  "tab_background_text_inactive": [
35
- 62,
36
- 62,
37
- 66
35
+ 168,
36
+ 168,
37
+ 174
38
38
  ],
39
39
  "tab_text_inactive": [
40
40
  255,
@@ -3,64 +3,5 @@
3
3
  "name": "Custom theme",
4
4
  "version": "1.0",
5
5
  "description": "A clean, minimal browser theme generated in the editor.",
6
- "author": "Anonymous",
7
- "theme": {
8
- "colors": {
9
- "frame": [
10
- 37,
11
- 37,
12
- 39
13
- ],
14
- "frame_inactive": [
15
- 49,
16
- 49,
17
- 53
18
- ],
19
- "toolbar": [
20
- 25,
21
- 25,
22
- 26
23
- ],
24
- "tab_background_text": [
25
- 28,
26
- 28,
27
- 30
28
- ],
29
- "tab_text": [
30
- 255,
31
- 255,
32
- 255
33
- ],
34
- "tab_background_text_inactive": [
35
- 62,
36
- 62,
37
- 66
38
- ],
39
- "tab_text_inactive": [
40
- 255,
41
- 255,
42
- 255
43
- ],
44
- "bookmark_text": [
45
- 153,
46
- 153,
47
- 159
48
- ],
49
- "ntp_background": [
50
- 28,
51
- 28,
52
- 30
53
- ],
54
- "ntp_text": [
55
- 255,
56
- 255,
57
- 255
58
- ],
59
- "button_background": [
60
- 28,
61
- 28,
62
- 30
63
- ]
64
- }
65
- }
6
+ "author": "Anonymous"
66
7
  }
package/dist/module.js CHANGED
@@ -130602,8 +130602,8 @@ var __webpack_modules__ = {
130602
130602
  var path__rspack_import_0 = __webpack_require__("path");
130603
130603
  var fs__rspack_import_1 = __webpack_require__("fs");
130604
130604
  var child_process__rspack_import_2 = __webpack_require__("child_process");
130605
- var pintor__rspack_import_3 = __webpack_require__("pintor");
130606
- var pintor__rspack_import_3_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_3);
130605
+ var _messages__rspack_import_3 = __webpack_require__("./webpack/plugin-css/css-lib/messages.ts");
130606
+ var _webpack_lib_check_build_dependencies__rspack_import_4 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
130607
130607
  function parseJsonSafe(text) {
130608
130608
  const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
130609
130609
  return JSON.parse(s || '{}');
@@ -130632,80 +130632,144 @@ var __webpack_modules__ = {
130632
130632
  if (execPath.includes('npm')) return 'npm';
130633
130633
  }
130634
130634
  }
130635
- function getLogPrefix(type) {
130636
- if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
130637
- const base = 'error' === type ? 'ERROR Author says' : '►►► Author says';
130638
- return pintor__rspack_import_3_default().brightMagenta(base);
130639
- }
130640
- return 'error' === type ? pintor__rspack_import_3_default().red('ERROR') : pintor__rspack_import_3_default().gray('►►►');
130641
- }
130642
130635
  async function resolvePackageManager() {
130643
130636
  const envPm = getPackageManagerFromEnv();
130644
130637
  if (envPm) return envPm;
130645
130638
  return 'npm';
130646
130639
  }
130647
- function getOptionalInstallCommand(pm, dependencies) {
130648
- const quotedDir = JSON.stringify(__dirname);
130640
+ function getOptionalInstallCommand(pm, dependencies, installBaseDir) {
130649
130641
  const pmName = pm;
130650
- if ('yarn' === pmName) return `yarn --silent add ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130651
- if ('npm' === pmName || isFromNpx()) return `npm --silent install ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130652
- if (isFromPnpx()) return `pnpm --silent add ${dependencies.join(' ')} --prefix ${quotedDir} --save-optional`;
130642
+ if ('yarn' === pmName) return {
130643
+ command: 'yarn',
130644
+ args: [
130645
+ '--silent',
130646
+ 'add',
130647
+ ...dependencies,
130648
+ '--cwd',
130649
+ installBaseDir,
130650
+ '--optional'
130651
+ ]
130652
+ };
130653
+ if ('npm' === pmName || isFromNpx()) return {
130654
+ command: 'npm',
130655
+ args: [
130656
+ '--silent',
130657
+ 'install',
130658
+ ...dependencies,
130659
+ '--prefix',
130660
+ installBaseDir,
130661
+ '--save-optional'
130662
+ ]
130663
+ };
130664
+ if (isFromPnpx()) return {
130665
+ command: 'pnpm',
130666
+ args: [
130667
+ '--silent',
130668
+ 'add',
130669
+ ...dependencies,
130670
+ '--prefix',
130671
+ installBaseDir,
130672
+ '--save-optional'
130673
+ ]
130674
+ };
130653
130675
  const fallback = pmName || 'npm';
130654
- return `${fallback} --silent install ${dependencies.join(' ')} --cwd ${quotedDir} --optional`;
130676
+ return {
130677
+ command: fallback,
130678
+ args: [
130679
+ '--silent',
130680
+ 'install',
130681
+ ...dependencies,
130682
+ '--cwd',
130683
+ installBaseDir,
130684
+ '--optional'
130685
+ ]
130686
+ };
130655
130687
  }
130656
130688
  function getRootInstallCommand(pm) {
130657
130689
  const pmName = pm;
130658
- if ('yarn' === pmName) return "yarn install --silent";
130659
- if ('npm' === pmName || isFromNpx()) return "npm install --silent";
130660
- if (isFromPnpx()) return "pnpm install --silent";
130661
- return `${pmName || 'npm'} install --silent`;
130662
- }
130663
- function formatToolingLabel(integrations, fallback) {
130664
- const list = integrations && integrations.length > 0 ? integrations.join('/') : fallback;
130665
- return `${getLogPrefix('info')} Setting up ${list} tooling...`;
130690
+ if ('yarn' === pmName) return {
130691
+ command: 'yarn',
130692
+ args: [
130693
+ 'install',
130694
+ '--silent'
130695
+ ]
130696
+ };
130697
+ if ('npm' === pmName || isFromNpx()) return {
130698
+ command: 'npm',
130699
+ args: [
130700
+ 'install',
130701
+ '--silent'
130702
+ ]
130703
+ };
130704
+ if (isFromPnpx()) return {
130705
+ command: 'pnpm',
130706
+ args: [
130707
+ 'install',
130708
+ '--silent'
130709
+ ]
130710
+ };
130711
+ return {
130712
+ command: pmName || 'npm',
130713
+ args: [
130714
+ 'install',
130715
+ '--silent'
130716
+ ]
130717
+ };
130666
130718
  }
130667
130719
  async function installOptionalDependencies(integration, dependencies) {
130668
130720
  if (!dependencies.length) return;
130669
130721
  try {
130670
130722
  const pm = await resolvePackageManager();
130671
- const installCommand = getOptionalInstallCommand(pm, dependencies);
130672
- console.log(formatToolingLabel([
130723
+ const installBaseDir = (0, _webpack_lib_check_build_dependencies__rspack_import_4.w1)() || process.cwd();
130724
+ const installCommand = getOptionalInstallCommand(pm, dependencies, installBaseDir);
130725
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
130726
+ console.log(_messages__rspack_import_3._j([
130673
130727
  integration
130674
- ], integration));
130675
- (0, child_process__rspack_import_2.execSync)(installCommand, {
130676
- stdio: 'inherit'
130728
+ ], integration, isAuthor));
130729
+ (0, child_process__rspack_import_2.execFileSync)(installCommand.command, installCommand.args, {
130730
+ stdio: 'inherit',
130731
+ cwd: installBaseDir
130677
130732
  });
130678
- await new Promise((r)=>setTimeout(r, 500));
130679
- if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
130680
- console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} [${integration}] Installing root dependencies for dev...`);
130681
- (0, child_process__rspack_import_2.execSync)(getRootInstallCommand(pm), {
130682
- stdio: 'ignore'
130733
+ await new Promise((resolve)=>setTimeout(resolve, 500));
130734
+ if (isAuthor) {
130735
+ console.log(_messages__rspack_import_3.cr(integration));
130736
+ const rootInstall = getRootInstallCommand(pm);
130737
+ (0, child_process__rspack_import_2.execFileSync)(rootInstall.command, rootInstall.args, {
130738
+ stdio: 'ignore',
130739
+ cwd: installBaseDir
130683
130740
  });
130684
- console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} ${integration} tooling ready.`);
130741
+ console.log(_messages__rspack_import_3.ys(integration));
130685
130742
  }
130686
130743
  } catch (error) {
130687
- console.error(`${getLogPrefix('error')} [${integration}] Failed to install dependencies.\n${pintor__rspack_import_3_default().red(String(error?.message || error))}`);
130744
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
130745
+ console.error(_messages__rspack_import_3.DX(integration, error, isAuthor));
130688
130746
  }
130689
130747
  }
130690
130748
  async function installOptionalDependenciesBatch(integration, dependencies, integrations) {
130691
130749
  if (!dependencies.length) return;
130692
130750
  try {
130693
130751
  const pm = await resolvePackageManager();
130694
- const installCommand = getOptionalInstallCommand(pm, dependencies);
130695
- console.log(formatToolingLabel(integrations, integration));
130696
- (0, child_process__rspack_import_2.execSync)(installCommand, {
130697
- stdio: 'inherit'
130752
+ const installBaseDir = (0, _webpack_lib_check_build_dependencies__rspack_import_4.w1)() || process.cwd();
130753
+ const installCommand = getOptionalInstallCommand(pm, dependencies, installBaseDir);
130754
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
130755
+ console.log(_messages__rspack_import_3._j(integrations, integration, isAuthor));
130756
+ (0, child_process__rspack_import_2.execFileSync)(installCommand.command, installCommand.args, {
130757
+ stdio: 'inherit',
130758
+ cwd: installBaseDir
130698
130759
  });
130699
- await new Promise((r)=>setTimeout(r, 500));
130700
- if ('true' === process.env.EXTENSION_AUTHOR_MODE) {
130701
- console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} [${integration}] Installing root dependencies for dev...`);
130702
- (0, child_process__rspack_import_2.execSync)(getRootInstallCommand(pm), {
130703
- stdio: 'ignore'
130760
+ await new Promise((resolve)=>setTimeout(resolve, 500));
130761
+ if (isAuthor) {
130762
+ console.log(_messages__rspack_import_3.cr(integration));
130763
+ const rootInstall = getRootInstallCommand(pm);
130764
+ (0, child_process__rspack_import_2.execFileSync)(rootInstall.command, rootInstall.args, {
130765
+ stdio: 'ignore',
130766
+ cwd: installBaseDir
130704
130767
  });
130705
- console.log(`${pintor__rspack_import_3_default().brightMagenta('►►► Author says')} ${integration} tooling ready.`);
130768
+ console.log(_messages__rspack_import_3.ys(integration));
130706
130769
  }
130707
130770
  } catch (error) {
130708
- console.error(`${getLogPrefix('error')} [${integration}] Failed to install dependencies.\n${pintor__rspack_import_3_default().red(String(error?.message || error))}`);
130771
+ const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
130772
+ console.error(_messages__rspack_import_3.DX(integration, error, isAuthor));
130709
130773
  }
130710
130774
  }
130711
130775
  function hasDependency(projectPath, dependency) {
@@ -130755,10 +130819,14 @@ var __webpack_modules__ = {
130755
130819
  "./webpack/plugin-css/css-lib/messages.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
130756
130820
  "use strict";
130757
130821
  __webpack_require__.d(__webpack_exports__, {
130822
+ DX: ()=>optionalInstallFailed,
130758
130823
  Jv: ()=>youAreAllSet,
130759
130824
  Se: ()=>missingSassDependency,
130825
+ _j: ()=>optionalToolingSetup,
130826
+ cr: ()=>optionalToolingRootInstall,
130760
130827
  fD: ()=>cssConfigsDetected,
130761
130828
  uo: ()=>cssIntegrationsEnabled,
130829
+ ys: ()=>optionalToolingReady,
130762
130830
  zA: ()=>isUsingIntegration
130763
130831
  });
130764
130832
  var pintor__rspack_import_0 = __webpack_require__("pintor");
@@ -130777,6 +130845,21 @@ var __webpack_modules__ = {
130777
130845
  function youAreAllSet(name) {
130778
130846
  return `${pintor__rspack_import_0_default().green('►►►')} ${name} installation completed.`;
130779
130847
  }
130848
+ function optionalToolingSetup(integrations, fallback, isAuthor) {
130849
+ const list = integrations && integrations.length > 0 ? integrations.join('/') : fallback;
130850
+ const prefix = isAuthor ? pintor__rspack_import_0_default().brightMagenta('►►► Author says') : pintor__rspack_import_0_default().gray('►►►');
130851
+ return `${prefix} Setting up ${list} tooling... (this is a one time op)`;
130852
+ }
130853
+ function optionalToolingRootInstall(integration) {
130854
+ return `${pintor__rspack_import_0_default().brightMagenta('►►► Author says')} [${integration}] Installing root dependencies for dev...`;
130855
+ }
130856
+ function optionalToolingReady(integration) {
130857
+ return `${pintor__rspack_import_0_default().brightMagenta('►►► Author says')} ${integration} tooling ready.`;
130858
+ }
130859
+ function optionalInstallFailed(integration, error, isAuthor) {
130860
+ const prefix = isAuthor ? pintor__rspack_import_0_default().brightMagenta('ERROR Author says') : pintor__rspack_import_0_default().red('ERROR');
130861
+ return `${prefix} [${integration}] Failed to install dependencies.\n${pintor__rspack_import_0_default().red(String(error?.message || error))}`;
130862
+ }
130780
130863
  function missingSassDependency() {
130781
130864
  const prefix = pintor__rspack_import_0_default().red('►►►');
130782
130865
  return [
@@ -131727,6 +131810,50 @@ var __webpack_modules__ = {
131727
131810
  };
131728
131811
  }
131729
131812
  },
131813
+ "./webpack/webpack-lib/check-build-dependencies.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131814
+ "use strict";
131815
+ __webpack_require__.d(__webpack_exports__, {
131816
+ Cf: ()=>getMissingBuildDependencies,
131817
+ S: ()=>areBuildDependenciesInstalled,
131818
+ Wb: ()=>loadBuildDependencies,
131819
+ w1: ()=>findExtensionDevelopRoot
131820
+ });
131821
+ var path__rspack_import_0 = __webpack_require__("path");
131822
+ var fs__rspack_import_1 = __webpack_require__("fs");
131823
+ function findExtensionDevelopRoot() {
131824
+ const webpackLibDir = __dirname;
131825
+ const webpackDir = path__rspack_import_0.resolve(webpackLibDir, '..');
131826
+ const packageRoot = path__rspack_import_0.resolve(webpackDir, '..');
131827
+ const packageJsonPath = path__rspack_import_0.join(packageRoot, 'package.json');
131828
+ if (fs__rspack_import_1.existsSync(packageJsonPath)) try {
131829
+ const pkg = JSON.parse(fs__rspack_import_1.readFileSync(packageJsonPath, 'utf-8'));
131830
+ if ('extension-develop' === pkg.name) return packageRoot;
131831
+ } catch {}
131832
+ return null;
131833
+ }
131834
+ function loadBuildDependencies() {
131835
+ const metadataPath = path__rspack_import_0.join(__dirname, 'build-dependencies.json');
131836
+ if (!fs__rspack_import_1.existsSync(metadataPath)) throw new Error(`build-dependencies.json not found at ${metadataPath}. This indicates a corrupted installation.`);
131837
+ try {
131838
+ const content = fs__rspack_import_1.readFileSync(metadataPath, 'utf-8');
131839
+ return JSON.parse(content);
131840
+ } catch (error) {
131841
+ throw new Error(`Failed to load build-dependencies.json: ${error.message}`);
131842
+ }
131843
+ }
131844
+ function isDependencyInstalled(dependency, packageRoot) {
131845
+ const nodeModulesPath = path__rspack_import_0.join(packageRoot, 'node_modules', dependency);
131846
+ return fs__rspack_import_1.existsSync(nodeModulesPath);
131847
+ }
131848
+ function areBuildDependenciesInstalled(packageRoot) {
131849
+ const dependencies = loadBuildDependencies();
131850
+ return Object.keys(dependencies).every((dep)=>isDependencyInstalled(dep, packageRoot));
131851
+ }
131852
+ function getMissingBuildDependencies(packageRoot) {
131853
+ const dependencies = loadBuildDependencies();
131854
+ return Object.keys(dependencies).filter((dep)=>!isDependencyInstalled(dep, packageRoot));
131855
+ }
131856
+ },
131730
131857
  "./webpack/webpack-lib/companion-extensions.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131731
131858
  "use strict";
131732
131859
  __webpack_require__.d(__webpack_exports__, {
@@ -132626,7 +132753,7 @@ var __webpack_modules__ = {
132626
132753
  },
132627
132754
  "./package.json" (module) {
132628
132755
  "use strict";
132629
- module.exports = JSON.parse('{"rE":"3.2.1","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"}}');
132756
+ module.exports = JSON.parse('{"rE":"3.3.0","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"}}');
132630
132757
  }
132631
132758
  };
132632
132759
  var __webpack_module_cache__ = {};
@@ -132937,40 +133064,8 @@ var __webpack_exports__ = {};
132937
133064
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.warn(error);
132938
133065
  }
132939
133066
  }
132940
- var paths = __webpack_require__("./webpack/webpack-lib/paths.ts");
132941
- function findExtensionDevelopRoot() {
132942
- const webpackLibDir = __dirname;
132943
- const webpackDir = external_path_.resolve(webpackLibDir, '..');
132944
- const packageRoot = external_path_.resolve(webpackDir, '..');
132945
- const packageJsonPath = external_path_.join(packageRoot, 'package.json');
132946
- if (external_fs_.existsSync(packageJsonPath)) try {
132947
- const pkg = JSON.parse(external_fs_.readFileSync(packageJsonPath, 'utf-8'));
132948
- if ('extension-develop' === pkg.name) return packageRoot;
132949
- } catch {}
132950
- return null;
132951
- }
132952
- function loadBuildDependencies() {
132953
- const metadataPath = external_path_.join(__dirname, 'build-dependencies.json');
132954
- if (!external_fs_.existsSync(metadataPath)) throw new Error(`build-dependencies.json not found at ${metadataPath}. This indicates a corrupted installation.`);
132955
- try {
132956
- const content = external_fs_.readFileSync(metadataPath, 'utf-8');
132957
- return JSON.parse(content);
132958
- } catch (error) {
132959
- throw new Error(`Failed to load build-dependencies.json: ${error.message}`);
132960
- }
132961
- }
132962
- function isDependencyInstalled(dependency, packageRoot) {
132963
- const nodeModulesPath = external_path_.join(packageRoot, 'node_modules', dependency);
132964
- return external_fs_.existsSync(nodeModulesPath);
132965
- }
132966
- function areBuildDependenciesInstalled(packageRoot) {
132967
- const dependencies = loadBuildDependencies();
132968
- return Object.keys(dependencies).every((dep)=>isDependencyInstalled(dep, packageRoot));
132969
- }
132970
- function getMissingBuildDependencies(packageRoot) {
132971
- const dependencies = loadBuildDependencies();
132972
- return Object.keys(dependencies).filter((dep)=>!isDependencyInstalled(dep, packageRoot));
132973
- }
133067
+ var webpack_lib_paths = __webpack_require__("./webpack/webpack-lib/paths.ts");
133068
+ var check_build_dependencies = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
132974
133069
  const external_cross_spawn_namespaceObject = require("cross-spawn");
132975
133070
  function detectPackageManagerFromEnv() {
132976
133071
  const userAgent = process.env.npm_config_user_agent || '';
@@ -133015,7 +133110,7 @@ var __webpack_exports__ = {};
133015
133110
  async function installOwnDependencies(dependencies, packageRoot) {
133016
133111
  if (0 === dependencies.length) return;
133017
133112
  if (!packageRoot) throw new Error('Package root is required for dependency installation');
133018
- const dependenciesMap = loadBuildDependencies();
133113
+ const dependenciesMap = (0, check_build_dependencies.Wb)();
133019
133114
  const missingFromMetadata = dependencies.filter((dep)=>!(dep in dependenciesMap));
133020
133115
  if (missingFromMetadata.length > 0) throw new Error(`Dependencies not found in build-dependencies.json: ${missingFromMetadata.join(', ')}`);
133021
133116
  const originalDirectory = process.cwd();
@@ -133088,9 +133183,9 @@ var __webpack_exports__ = {};
133088
133183
  }
133089
133184
  }
133090
133185
  async function ensureDependencies(projectPath, opts) {
133091
- const packageRoot = findExtensionDevelopRoot();
133092
- const missingBuild = packageRoot && !areBuildDependenciesInstalled(packageRoot) ? getMissingBuildDependencies(packageRoot) : [];
133093
- const shouldInstallUserDeps = !!projectPath && !opts?.skipProjectInstall && (0, paths.Bi)((0, paths.G6)(projectPath));
133186
+ const packageRoot = (0, check_build_dependencies.w1)();
133187
+ const missingBuild = packageRoot && !(0, check_build_dependencies.S)(packageRoot) ? (0, check_build_dependencies.Cf)(packageRoot) : [];
133188
+ const shouldInstallUserDeps = !!projectPath && !opts?.skipProjectInstall && (0, webpack_lib_paths.Bi)((0, webpack_lib_paths.G6)(projectPath));
133094
133189
  const needsBuildInstall = missingBuild.length > 0;
133095
133190
  const needsUserInstall = shouldInstallUserDeps;
133096
133191
  if (!needsBuildInstall && !needsUserInstall) return {
@@ -133170,7 +133265,7 @@ var __webpack_exports__ = {};
133170
133265
  }
133171
133266
  }
133172
133267
  function getPreflightMarkerPath(projectPath) {
133173
- const packageRoot = findExtensionDevelopRoot();
133268
+ const packageRoot = (0, check_build_dependencies.w1)();
133174
133269
  if (!packageRoot) return;
133175
133270
  const cacheDir = getPreflightCacheDir(packageRoot);
133176
133271
  return external_path_.join(cacheDir, `${getProjectKey(projectPath)}.json`);
@@ -133230,27 +133325,35 @@ var __webpack_exports__ = {};
133230
133325
  var less = __webpack_require__("./webpack/plugin-css/css-tools/less.ts");
133231
133326
  var postcss = __webpack_require__("./webpack/plugin-css/css-tools/postcss.ts");
133232
133327
  var js_frameworks_lib_messages = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
133328
+ function getResolutionPaths(projectPath) {
133329
+ const extensionRoot = (0, check_build_dependencies.w1)();
133330
+ const paths = [
133331
+ projectPath || void 0,
133332
+ extensionRoot || void 0,
133333
+ process.cwd()
133334
+ ].filter(Boolean);
133335
+ return Array.from(new Set(paths));
133336
+ }
133233
133337
  function canResolveFromProject(id, projectPath) {
133234
133338
  try {
133235
133339
  return require.resolve(id, {
133236
- paths: [
133237
- projectPath,
133238
- process.cwd()
133239
- ]
133340
+ paths: getResolutionPaths(projectPath)
133240
133341
  });
133241
133342
  } catch {
133242
133343
  return;
133243
133344
  }
133244
133345
  }
133245
- function canResolve(id) {
133346
+ function canResolve(id, projectPath) {
133246
133347
  try {
133247
- return require.resolve(id);
133348
+ return require.resolve(id, {
133349
+ paths: getResolutionPaths(projectPath)
133350
+ });
133248
133351
  } catch {
133249
133352
  return;
133250
133353
  }
133251
133354
  }
133252
133355
  async function preflightOptionalDependencies(projectStructure, mode, opts) {
133253
- const { packageJsonDir } = (0, paths.fu)(projectStructure);
133356
+ const { packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133254
133357
  const projectPath = packageJsonDir;
133255
133358
  if (hasPreflightMarker(projectPath)) {
133256
133359
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(`${external_pintor_default().brightMagenta('►►► Author says')} Optional deps preflight skipped (cache hit).`);
@@ -133266,67 +133369,74 @@ var __webpack_exports__ = {};
133266
133369
  const usesSass = (0, sass.fZ)(projectPath);
133267
133370
  const usesLess = (0, less.K)(projectPath);
133268
133371
  const usesPostCss = (0, postcss.A)(projectPath);
133269
- if (usesTypeScript && !canResolveFromProject("typescript", projectPath)) {
133270
- missingOptionalDeps.add("typescript");
133271
- usedIntegrations.push('TypeScript');
133372
+ if (usesTypeScript) {
133373
+ if (!canResolveFromProject("typescript", projectPath)) {
133374
+ missingOptionalDeps.add("typescript");
133375
+ usedIntegrations.push('TypeScript');
133376
+ }
133272
133377
  }
133273
133378
  if (usesReact) {
133274
- if (!canResolve('react-refresh')) missingOptionalDeps.add('react-refresh');
133275
- if (!canResolve('@rspack/plugin-react-refresh')) missingOptionalDeps.add('@rspack/plugin-react-refresh');
133379
+ if (!canResolve('react-refresh', projectPath)) missingOptionalDeps.add('react-refresh');
133380
+ if (!canResolve('@rspack/plugin-react-refresh', projectPath)) missingOptionalDeps.add('@rspack/plugin-react-refresh');
133276
133381
  usedIntegrations.push('React');
133277
133382
  }
133278
133383
  if (usesPreact) {
133279
- if (!canResolve('@prefresh/core')) missingOptionalDeps.add('@prefresh/core');
133280
- if (!canResolve('@prefresh/utils')) missingOptionalDeps.add('@prefresh/utils');
133281
- if (!canResolve('@rspack/plugin-preact-refresh')) missingOptionalDeps.add('@rspack/plugin-preact-refresh');
133282
- if (!canResolve('preact')) missingOptionalDeps.add('preact');
133384
+ if (!canResolve('@prefresh/core', projectPath)) missingOptionalDeps.add('@prefresh/core');
133385
+ if (!canResolve('@prefresh/utils', projectPath)) missingOptionalDeps.add('@prefresh/utils');
133386
+ if (!canResolve('@rspack/plugin-preact-refresh', projectPath)) missingOptionalDeps.add('@rspack/plugin-preact-refresh');
133387
+ if (!canResolve('preact', projectPath)) missingOptionalDeps.add('preact');
133283
133388
  usedIntegrations.push('Preact');
133284
133389
  }
133285
133390
  if (usesVue) {
133286
- if (!canResolve('vue-loader')) missingOptionalDeps.add('vue-loader');
133287
- if (!canResolve('@vue/compiler-sfc')) missingOptionalDeps.add('@vue/compiler-sfc');
133391
+ if (!canResolve('vue-loader', projectPath)) missingOptionalDeps.add('vue-loader');
133392
+ if (!canResolve('@vue/compiler-sfc', projectPath)) missingOptionalDeps.add('@vue/compiler-sfc');
133288
133393
  usedIntegrations.push('Vue');
133289
133394
  }
133290
133395
  if (usesSvelte) {
133291
- if (!canResolveFromProject('svelte-loader', projectPath) && !canResolve('svelte-loader')) missingOptionalDeps.add('svelte-loader');
133396
+ if (!canResolveFromProject('svelte-loader', projectPath) && !canResolve('svelte-loader', projectPath)) missingOptionalDeps.add('svelte-loader');
133292
133397
  if (!canResolveFromProject("typescript", projectPath)) missingOptionalDeps.add("typescript");
133293
133398
  usedIntegrations.push('Svelte');
133294
133399
  }
133295
- if (usesSass && !canResolve('sass-loader')) {
133296
- const postCssDeps = [
133297
- 'postcss-loader',
133298
- 'postcss-scss',
133299
- 'postcss-preset-env'
133300
- ];
133301
- for (const dep of postCssDeps)if (!canResolve(dep)) missingOptionalDeps.add(dep);
133302
- missingOptionalDeps.add('sass-loader');
133303
- usedIntegrations.push('Sass');
133400
+ if (usesSass) {
133401
+ if (!canResolve('sass-loader', projectPath)) {
133402
+ const postCssDeps = [
133403
+ 'postcss-loader',
133404
+ 'postcss-scss',
133405
+ 'postcss-preset-env'
133406
+ ];
133407
+ for (const dep of postCssDeps)if (!canResolve(dep, projectPath)) missingOptionalDeps.add(dep);
133408
+ missingOptionalDeps.add('sass-loader');
133409
+ usedIntegrations.push('Sass');
133410
+ }
133304
133411
  }
133305
- if (usesLess && !canResolve('less-loader')) {
133306
- if (!canResolve('less')) missingOptionalDeps.add('less');
133307
- missingOptionalDeps.add('less-loader');
133308
- usedIntegrations.push('Less');
133412
+ if (usesLess) {
133413
+ if (!canResolve('less-loader', projectPath)) {
133414
+ if (!canResolve('less', projectPath)) missingOptionalDeps.add('less');
133415
+ missingOptionalDeps.add('less-loader');
133416
+ usedIntegrations.push('Less');
133417
+ }
133309
133418
  }
133310
- if (usesPostCss && !canResolve('postcss-loader') && !usesSass && !usesLess) {
133311
- if (!canResolve('postcss')) missingOptionalDeps.add('postcss');
133419
+ if (usesPostCss && !canResolve('postcss-loader', projectPath) && !usesSass && !usesLess) {
133420
+ if (!canResolve('postcss', projectPath)) missingOptionalDeps.add('postcss');
133312
133421
  missingOptionalDeps.add('postcss-loader');
133313
133422
  usedIntegrations.push('PostCSS');
133314
133423
  }
133315
133424
  if (missingOptionalDeps.size > 0) {
133316
133425
  const uniqueIntegrations = Array.from(new Set(usedIntegrations));
133317
133426
  await (0, integrations.Dy)('Optional', Array.from(missingOptionalDeps), uniqueIntegrations);
133318
- if (opts?.showRunAgainMessage !== false) console.log(js_frameworks_lib_messages.Q2(uniqueIntegrations));
133427
+ if (opts?.showRunAgainMessage !== false && 'true' === process.env.EXTENSION_AUTHOR_MODE) console.log(js_frameworks_lib_messages.Q2(uniqueIntegrations));
133319
133428
  if (opts?.exitOnInstall !== false) process.exit(0);
133320
133429
  }
133321
133430
  writePreflightMarker(projectPath);
133322
133431
  }
133323
133432
  function shouldRunOptionalPreflight(projectStructure) {
133324
- const { packageJsonDir } = (0, paths.fu)(projectStructure);
133433
+ const { packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133325
133434
  const projectPath = packageJsonDir;
133326
- return !hasPreflightMarker(projectPath);
133435
+ if (hasPreflightMarker(projectPath)) return false;
133436
+ return true;
133327
133437
  }
133328
133438
  async function ensureProjectReady(projectStructure, mode, opts) {
133329
- const { packageJsonDir } = (0, paths.fu)(projectStructure);
133439
+ const { packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133330
133440
  const result = await ensureDependencies(packageJsonDir, opts);
133331
133441
  if (shouldRunOptionalPreflight(projectStructure)) await preflightOptionalDependencies(projectStructure, mode, {
133332
133442
  exitOnInstall: opts?.exitOnInstall
@@ -133337,8 +133447,8 @@ var __webpack_exports__ = {};
133337
133447
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
133338
133448
  const isVitest = 'true' === process.env.VITEST;
133339
133449
  const shouldExitOnError = (buildOptions?.exitOnError ?? true) && !isVitest;
133340
- const browser = (0, paths.YN)(buildOptions?.browser || 'chrome', buildOptions?.chromiumBinary, buildOptions?.geckoBinary || buildOptions?.firefoxBinary);
133341
- const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
133450
+ const browser = (0, webpack_lib_paths.YN)(buildOptions?.browser || 'chrome', buildOptions?.chromiumBinary, buildOptions?.geckoBinary || buildOptions?.firefoxBinary);
133451
+ const { manifestDir, packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133342
133452
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
133343
133453
  try {
133344
133454
  const shouldInstallProjectDeps = !isAuthor || buildOptions?.install !== false;
@@ -133359,7 +133469,7 @@ var __webpack_exports__ = {};
133359
133469
  const debug = isAuthor;
133360
133470
  if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
133361
133471
  const commandConfig = await (0, config_loader.eY)(manifestDir, 'build');
133362
- const distPath = (0, paths.q4)(packageJsonDir, browser);
133472
+ const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
133363
133473
  if (debug) {
133364
133474
  console.log(messages.SG(manifestDir, packageJsonDir));
133365
133475
  console.log(messages._A(browser, buildOptions?.chromiumBinary, buildOptions?.geckoBinary || buildOptions?.firefoxBinary));
@@ -133602,7 +133712,7 @@ export {}
133602
133712
  try {
133603
133713
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
133604
133714
  const debug = isAuthor;
133605
- const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
133715
+ const { manifestDir, packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133606
133716
  const shouldInstallProjectDeps = !isAuthor || false !== devOptions.install;
133607
133717
  await ensureProjectReady(projectStructure, 'development', {
133608
133718
  skipProjectInstall: !projectStructure.packageJsonPath || !shouldInstallProjectDeps,
@@ -133611,7 +133721,7 @@ export {}
133611
133721
  });
133612
133722
  if ((0, typescript.eE)(manifestDir)) await generateExtensionTypes(manifestDir, packageJsonDir);
133613
133723
  if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
133614
- const browser = (0, paths.YN)(devOptions.browser || 'chrome', devOptions.chromiumBinary, devOptions.geckoBinary || devOptions.firefoxBinary);
133724
+ const browser = (0, webpack_lib_paths.YN)(devOptions.browser || 'chrome', devOptions.chromiumBinary, devOptions.geckoBinary || devOptions.firefoxBinary);
133615
133725
  const geckoBinary = devOptions.geckoBinary || devOptions.firefoxBinary;
133616
133726
  if (debug) {
133617
133727
  console.log(messages.SG(manifestDir, packageJsonDir));
@@ -133718,10 +133828,10 @@ export {}
133718
133828
  const projectStructure = await getProjectStructure(pathOrRemoteUrl);
133719
133829
  const debug = 'true' === process.env.EXTENSION_AUTHOR_MODE;
133720
133830
  if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, external_path_.dirname(projectStructure.manifestPath));
133721
- const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
133722
- const browser = (0, paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
133723
- const outputPath = (0, paths.u2)(projectStructure, browser, previewOptions.outputPath);
133724
- const distPath = (0, paths.q4)(packageJsonDir, browser);
133831
+ const { manifestDir, packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133832
+ const browser = (0, webpack_lib_paths.YN)(previewOptions.browser || 'chrome', previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary);
133833
+ const outputPath = (0, webpack_lib_paths.u2)(projectStructure, browser, previewOptions.outputPath);
133834
+ const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
133725
133835
  if (debug) {
133726
133836
  console.log(messages.SG(manifestDir, packageJsonDir));
133727
133837
  console.log(messages._A(browser, previewOptions.chromiumBinary, previewOptions.geckoBinary || previewOptions.firefoxBinary));
@@ -133781,11 +133891,11 @@ export {}
133781
133891
  exitOnInstall: false,
133782
133892
  showRunAgainMessage: false
133783
133893
  });
133784
- const browser = (0, paths.YN)(startOptions.browser || 'chrome', startOptions.chromiumBinary, startOptions.geckoBinary || startOptions.firefoxBinary);
133785
- const { manifestDir, packageJsonDir } = (0, paths.fu)(projectStructure);
133894
+ const browser = (0, webpack_lib_paths.YN)(startOptions.browser || 'chrome', startOptions.chromiumBinary, startOptions.geckoBinary || startOptions.firefoxBinary);
133895
+ const { manifestDir, packageJsonDir } = (0, webpack_lib_paths.fu)(projectStructure);
133786
133896
  const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'start');
133787
133897
  const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
133788
- const distPath = (0, paths.q4)(packageJsonDir, browser);
133898
+ const distPath = (0, webpack_lib_paths.q4)(packageJsonDir, browser);
133789
133899
  if (debug) {
133790
133900
  console.log(messages.SG(manifestDir, packageJsonDir));
133791
133901
  console.log(messages._A(browser, startOptions.chromiumBinary, startOptions.geckoBinary || startOptions.firefoxBinary));
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "dist"
23
23
  ],
24
24
  "name": "extension-develop",
25
- "version": "3.2.1",
25
+ "version": "3.3.0",
26
26
  "description": "Develop, build, preview, and package Extension.js projects.",
27
27
  "author": {
28
28
  "name": "Cezar Augusto",